Skip to content
Snippets Groups Projects
Commit 13dde0b3 authored by Yannis Barlas's avatar Yannis Barlas Committed by john
Browse files

use existing surface function to disable tools when note is selected

parent c6e5c1ff
No related branches found
No related tags found
No related merge requests found
......@@ -216,7 +216,7 @@ class ContainerEditor extends SubstanceContainerEditor {
const commandStates = this.getCommandStates()
each(keys(commandStates), key => {
const allowed = ['comment', 'note', 'save', 'undo', 'redo', 'track-change-toggle-view']
const allowed = ['comment', 'save', 'undo', 'redo', 'track-change-toggle-view']
if (!includes(allowed, key)) commandStates[key].disabled = true
})
}
......
......@@ -42,14 +42,9 @@ class NoteComponent extends Component {
// TODO -- review
disableTools () {
const commandStates = this.getCommandStates()
// TODO -- this uses the same code as the fn in container editor
// use the fn from there
each(keys(commandStates), (key) => {
const allowed = ['comment', 'redo', 'save', 'switch-text-type', 'undo']
if (!includes(allowed, key)) commandStates[key].disabled = true
})
const surface = this.getSurface()
if (!surface) return
surface.disableToolbar()
// TODO -- do we need the rerender here??
this.rerender()
......
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