diff --git a/app/components/SimpleEditor/ContainerEditor.js b/app/components/SimpleEditor/ContainerEditor.js index e2e44955ddb5cc5667ba2df8d5c1cabe129939a4..71fb5c33c588d95fc9b95e38a542d640273fae14 100644 --- a/app/components/SimpleEditor/ContainerEditor.js +++ b/app/components/SimpleEditor/ContainerEditor.js @@ -33,28 +33,34 @@ class ContainerEditor extends SubstanceContainerEditor { // open for editing // TODO -- should maybe change to isEditable ? + // or maybe deleted? we never pass a disabled prop explicitly if (!this.props.disabled) { el.addClass('sm-enabled') el.setAttribute('contenteditable', true) } // editing locked, selection open (for comments) - if (this.isReadOnlyMode()) { - const documentSession = this.getDocumentSession() - documentSession.on('didUpdate', this.disableToolbar, this) - } + // if (this.isReadOnlyMode()) { + // const documentSession = this.getDocumentSession() + // documentSession.on('didUpdate', this.disableToolbar, this) + // } return el } didMount () { - // TODO -- replace with super + // TODO -- replace with super.didMount() Surface.prototype.didMount.apply(this, arguments) this.container.on('nodes:changed', this.onContainerChange, this) if (this.isEmpty()) this.createText() - if (this.isReadOnlyMode()) this.addTargetToLinks() + if (this.isReadOnlyMode()) { + const documentSession = this.getDocumentSession() + documentSession.on('didUpdate', this.disableToolbar, this) + + this.addTargetToLinks() + } } // create an empty paragraph with an empty node