refactoring

This commit is contained in:
Philipp Kühn
2021-06-14 15:35:43 +02:00
parent fbc8fffb70
commit f7890c0b42

View File

@@ -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 {