From 426cae599134cbc0fd422709704fa68565239a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Sun, 29 Mar 2020 21:04:56 +0200 Subject: [PATCH] update dispatchTransaction --- packages/tiptap-core/src/Editor.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/tiptap-core/src/Editor.ts b/packages/tiptap-core/src/Editor.ts index 77995df2..b8980749 100644 --- a/packages/tiptap-core/src/Editor.ts +++ b/packages/tiptap-core/src/Editor.ts @@ -161,23 +161,21 @@ export class Editor extends EventEmitter { const state = this.state.apply(transaction) this.view.updateState(state) this.storeSelection() + this.setActiveNodesAndMarks() - // this.setActiveNodesAndMarks() - - // this.emit('transaction', { - // getHTML: this.getHTML.bind(this), - // getJSON: this.getJSON.bind(this), - // state: this.state, - // transaction, - // }) + this.emit('transaction', { transaction }) if (!transaction.docChanged || transaction.getMeta('preventUpdate')) { return } - // this.emitUpdate(transaction) + this.emit('update', { transaction }) } + public setActiveNodesAndMarks() { + // TODO + } + public setContent(content: EditorContent = '', emitUpdate: Boolean = false, parseOptions: any = {}) { const { doc, tr } = this.state const document = this.createDocument(content, parseOptions)