Skip to content
Snippets Groups Projects
Commit 6c714c29 authored by chris's avatar chris Committed by Yannis Barlas
Browse files

initial track changes

parent 86683c08
No related branches found
No related tags found
No related merge requests found
import { Tool } from 'substance' import { Tool } from 'substance'
class TrackChangeControlTool extends Tool { class TrackChangeControlTool extends Tool {
getClassNames () {
return 'sm-target-track-change-enable'
}
renderButton ($$) { renderButton ($$) {
const el = super.renderButton($$) const el = super.renderButton($$)
......
import { Tool } from 'substance' import { Tool } from 'substance'
class TrackChangeControlViewTool extends Tool { class TrackChangeControlViewTool extends Tool {
getClassNames () {
return 'sm-target-track-change-toggle-view'
}
renderButton ($$) { renderButton ($$) {
const el = super.renderButton($$) const el = super.renderButton($$)
if (this.getViewMode()) el.addClass('track-changes-view-active') if (this.getViewMode()) el.addClass('track-changes-view-active')
...@@ -15,8 +19,8 @@ class TrackChangeControlViewTool extends Tool { ...@@ -15,8 +19,8 @@ class TrackChangeControlViewTool extends Tool {
getViewMode () { getViewMode () {
const editor = this.context.editor const editor = this.context.editor
const { trackChangesView } = editor.state const { trackChangesView } = editor.state
return trackChangesView return trackChangesView
} }
} }
......
...@@ -660,7 +660,6 @@ class TrackChangesProvider extends TOCProvider { ...@@ -660,7 +660,6 @@ class TrackChangesProvider extends TOCProvider {
getAllExistingTrackAnnotations () { getAllExistingTrackAnnotations () {
const editorSession = this.getEditorSession() const editorSession = this.getEditorSession()
// const selectionState = documentSession.getSelectionState()
const selectionState = editorSession.getSelectionState() const selectionState = editorSession.getSelectionState()
const annotations = selectionState.getAnnotationsForType('track-change') const annotations = selectionState.getAnnotationsForType('track-change')
return annotations return annotations
...@@ -762,7 +761,7 @@ class TrackChangesProvider extends TOCProvider { ...@@ -762,7 +761,7 @@ class TrackChangesProvider extends TOCProvider {
// const lastChange = last(undoneChanges) // const lastChange = last(undoneChanges)
// const op = last(lastChange.ops) // const op = last(lastChange.ops)
// //
// const isTrack = op.path[0].split('-').slice(0, -1).join('-') === 'track-change' // const isTrack = op.path[0].split('-').slice(0, -1).join('-') === 'track-change
} }
/* /*
......
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