refactoring
This commit is contained in:
@@ -224,14 +224,16 @@ export class NodeView<Component, Editor extends CoreEditor = CoreEditor> impleme
|
||||
}
|
||||
|
||||
updateAttributes(attributes: {}) {
|
||||
const { state } = this.editor.view
|
||||
this.editor.commands.command(({ tr }) => {
|
||||
const pos = this.getPos()
|
||||
const transaction = state.tr.setNodeMarkup(pos, undefined, {
|
||||
|
||||
tr.setNodeMarkup(pos, undefined, {
|
||||
...this.node.attrs,
|
||||
...attributes,
|
||||
})
|
||||
|
||||
this.editor.view.dispatch(transaction)
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
deleteNode(): void {
|
||||
|
||||
Reference in New Issue
Block a user