Skip to content
Snippets Groups Projects
Commit e9671570 authored by Yannis Barlas's avatar Yannis Barlas
Browse files

Merged in empty-doc-disabled-tools (pull request #14)

fix toolbar being disabled for new docs even if user has edit rights
parents a73c475f 3fa83635
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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