Skip to content
Snippets Groups Projects
Commit e3b5b1f2 authored by Alexandros Georgantas's avatar Alexandros Georgantas Committed by Yannis Barlas
Browse files

Toggle Changes View button fixed

parent 2d0b2b02
No related branches found
No related tags found
No related merge requests found
......@@ -22,13 +22,15 @@ class Editor extends ProseEditor {
'showComments': function () { this.toggleCommentsArea(true) },
'hideComments': function () { this.toggleCommentsArea(false) },
'trackChangesUpdate': function () { this.updateTrackChange() },
'domSelectionRendered': function () { this.domSelectionRendered() }
'trackChangesViewToggle': function () { this.trackChangesViewToggle() }
})
}
domSelectionRendered () {
trackChangesViewToggle () {
// TODO what to handle here????
// console.log('rendered')
this.extendState({
trackChangesView: !this.state.trackChangesView
})
}
updateTrackChange () {
......@@ -149,6 +151,7 @@ class Editor extends ProseEditor {
$$(Toolbar, {
commandStates: commandStates,
trackChanges: this.props.trackChanges,
trackChangesView: this.state.trackChangesView,
toolGroups: ['text', 'document', 'annotations', 'default', 'track-change-enable', 'track-change-toggle-view']
}).ref('toolbar')
)
......
......@@ -13,7 +13,7 @@ class TrackChangeControlViewCommand extends Command {
// TODO -- review
execute (params, context) {
const surface = context.surfaceManager.getSurface('body')
surface.send('trackChangesViewUpdate')
surface.send('trackChangesViewToggle')
surface.rerender()
return true
}
......
......@@ -2,9 +2,6 @@ import { Tool } from 'substance'
class TrackChangeControlViewTool extends Tool {
getClassNames () {
return 'sm-target-track-change-toggle-view'
}
renderButton ($$) {
const el = super.renderButton($$)
if (this.getViewMode()) el.addClass('track-changes-view-active')
......@@ -18,9 +15,9 @@ class TrackChangeControlViewTool extends Tool {
}
getViewMode () {
const editor = this.context.controller
var trackChangesView = true
// const { trackChangesView } = editor.state
const editor = this.context.editor
const { trackChangesView } = editor.state
return 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