Commit 87253ab4 authored by Christos's avatar Christos
Browse files

Merge branch 'wax-fixes' into 'master'

fixes

See merge request !319
parents c04453ff c7f0e7e2
......@@ -324,6 +324,8 @@ class ContainerEditor extends SubstanceContainerEditor {
// each pkg instead if trackChanges is on
checkChange(change) {
if (!this.props.trackChanges) return
// disable for now
return false
const { trackChangesProvider } = this.context
......
import { EditorSession as SubstanceEditorSession } from 'substance'
import { documentHelpers } from 'substance'
class EditorSession extends SubstanceEditorSession {
constructor(...props) {
......@@ -7,6 +8,23 @@ class EditorSession extends SubstanceEditorSession {
this.onUpdate('', this.autoSave, this)
}
undo() {
super.undo()
const notes = documentHelpers.getPropertyAnnotationsForSelection(
this.getDocument(),
this.getSelection(),
{ type: 'note' },
)
if (notes.length >= 1) {
forEach(notes, note => {
if (note.disabled) {
note.disabled = false
this.editor.emit('updateNotes')
}
})
}
}
autoSave() {
if (
!this.configurator.config.autoSave ||
......
......@@ -78,6 +78,7 @@ class TrackChangesProvider extends AbstractProvider {
editor.emit('ui:updated')
},
})
editor.on('updateNotes', this.updateNotes, this)
}
static get NodeType() {
......@@ -96,6 +97,11 @@ class TrackChangesProvider extends AbstractProvider {
return new TrackChangesProvider(context.doc, config)
}
updateNotes() {
const editor = this.config.controller
editor.rerender()
}
/*
HANDLERS
......
Markdown is supported
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