Skip to content
Snippets Groups Projects
Commit e5559a11 authored by Alexandros Georgantas's avatar Alexandros Georgantas Committed by john
Browse files

Track changes view toggle in notes editor fixed

parent 3f318d94
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,6 @@ class TrackChangeComponent extends AnnotationComponent { ...@@ -44,7 +44,6 @@ class TrackChangeComponent extends AnnotationComponent {
el.addClass('sc-track-change-' + status) el.addClass('sc-track-change-' + status)
if (viewMode === false) { if (viewMode === false) {
console.log('status', status)
if (status === 'delete') el.addClass('sc-track-delete-hide') if (status === 'delete') el.addClass('sc-track-delete-hide')
if (status === 'add') el.addClass('sc-track-add-show') if (status === 'add') el.addClass('sc-track-add-show')
} }
......
...@@ -21,6 +21,12 @@ class NotesEditor extends ProseEditor { ...@@ -21,6 +21,12 @@ class NotesEditor extends ProseEditor {
this.on('notes:deleted', this.removeNote, this) this.on('notes:deleted', this.removeNote, this)
} }
getInitialState () {
return {
trackChangesView: this.props.trackChangesView
}
}
render ($$) { render ($$) {
const el = $$('div').addClass('sc-notes-editor') const el = $$('div').addClass('sc-notes-editor')
let toolbar = this._renderNotesToolbar($$) let toolbar = this._renderNotesToolbar($$)
...@@ -80,6 +86,7 @@ class NotesEditor extends ProseEditor { ...@@ -80,6 +86,7 @@ class NotesEditor extends ProseEditor {
fragment: this.props.fragment, fragment: this.props.fragment,
spellcheck: 'native', spellcheck: 'native',
trackChanges: this.props.trackChanges, trackChanges: this.props.trackChanges,
trackChangesView: this.props.trackChangesView,
user: this.props.user user: this.props.user
}).ref('notes_body') }).ref('notes_body')
} }
......
...@@ -37,6 +37,7 @@ class Notes extends Component { ...@@ -37,6 +37,7 @@ class Notes extends Component {
disabled: notesEditorProps.disabled, disabled: notesEditorProps.disabled,
fragment: notesEditorProps.fragment, fragment: notesEditorProps.fragment,
trackChanges: notesEditorProps.trackChanges, trackChanges: notesEditorProps.trackChanges,
trackChangesView: notesEditorProps.trackChangesView,
update: notesEditorProps.update, update: notesEditorProps.update,
user: notesEditorProps.user user: notesEditorProps.user
})) }))
...@@ -123,6 +124,10 @@ class Notes extends Component { ...@@ -123,6 +124,10 @@ class Notes extends Component {
getParentProps () { getParentProps () {
const editor = this.context.editor const editor = this.context.editor
const commentsProvider = this.context.commentsProvider const commentsProvider = this.context.commentsProvider
let trackChangesView = ''
if (editor.refs.toolbar) {
trackChangesView = editor.refs.toolbar.props.trackChangesView
}
return { return {
comments: commentsProvider.config.comments, comments: commentsProvider.config.comments,
...@@ -132,7 +137,8 @@ class Notes extends Component { ...@@ -132,7 +137,8 @@ class Notes extends Component {
history: editor.props.history, history: editor.props.history,
trackChanges: editor.props.trackChanges, trackChanges: editor.props.trackChanges,
update: editor.props.update, update: editor.props.update,
user: editor.props.user user: editor.props.user,
trackChangesView: trackChangesView
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment