add check in ComponentView for editable
This commit is contained in:
@@ -36,6 +36,10 @@ export default class ComponentView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateAttrs(attrs) {
|
updateAttrs(attrs) {
|
||||||
|
if (!this.editable) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const transaction = this.view.state.tr.setNodeMarkup(this.getPos(), null, {
|
const transaction = this.view.state.tr.setNodeMarkup(this.getPos(), null, {
|
||||||
...this.node.attrs,
|
...this.node.attrs,
|
||||||
...attrs,
|
...attrs,
|
||||||
@@ -44,6 +48,10 @@ export default class ComponentView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateContent(content) {
|
updateContent(content) {
|
||||||
|
if (!this.editable) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const transaction = this.view.state.tr.setNodeMarkup(this.getPos(), this.node.type, { content })
|
const transaction = this.view.state.tr.setNodeMarkup(this.getPos(), this.node.type, { content })
|
||||||
this.view.dispatch(transaction)
|
this.view.dispatch(transaction)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user