From be8d7e8914c37267942080de8fbe274e052d394c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 2 Aug 2023 14:27:27 +0200 Subject: [PATCH] fix: Use setEditable instead of options to propagate update of the state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/BaseReader.vue | 2 +- src/components/CollisionResolveDialog.vue | 4 ++-- src/components/Editor.vue | 6 +++--- src/components/Editor/MarkdownContentEditor.vue | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/BaseReader.vue b/src/components/BaseReader.vue index 8774fe17dc3..39c1a25b52f 100644 --- a/src/components/BaseReader.vue +++ b/src/components/BaseReader.vue @@ -92,7 +92,7 @@ export default { created() { this.$editor = this.createEditor() - this.$editor.setOptions({ editable: false }) + this.$editor.setEditable(false) }, beforeDestroy() { diff --git a/src/components/CollisionResolveDialog.vue b/src/components/CollisionResolveDialog.vue index e25f6a008dc..7de994c7d06 100644 --- a/src/components/CollisionResolveDialog.vue +++ b/src/components/CollisionResolveDialog.vue @@ -65,12 +65,12 @@ export default { resolveThisVersion() { this.clicked = true this.$syncService.forceSave().then(() => this.$syncService.syncUp()) - this.$editor.setOptions({ editable: !this.readOnly }) + this.$editor.setEditable(!this.readOnly) }, resolveServerVersion() { const { outsideChange } = this.syncError.data this.clicked = true - this.$editor.setOptions({ editable: !this.readOnly }) + this.$editor.setEditable(!this.readOnly) this.setContent(outsideChange, { isRich: this.$isRichEditor }) this.$syncService.forceSave().then(() => this.$syncService.syncUp()) }, diff --git a/src/components/Editor.vue b/src/components/Editor.vue index 8820757517b..6b735bf8103 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -456,7 +456,7 @@ export default { this.document = document this.readOnly = document.readOnly if (this.$editor) { - this.$editor.setOptions({ editable: !this.readOnly }) + this.$editor.setEditable(!this.readOnly) } this.lock = this.$syncService.lock localStorage.setItem('nick', this.currentSession.guestName) @@ -547,7 +547,7 @@ export default { this.document = document this.syncError = null - this.$editor.setOptions({ editable: !this.readOnly }) + this.$editor.setEditable(!this.readOnly) }, onSync({ steps, document }) { @@ -616,7 +616,7 @@ export default { this.$syncService.close() this.idle = true this.readOnly = true - this.$editor.setOptions({ editable: !this.readOnly }) + this.$editor.setEditable(!this.readOnly) this.$nextTick(() => { this.emit('sync-service:idle') diff --git a/src/components/Editor/MarkdownContentEditor.vue b/src/components/Editor/MarkdownContentEditor.vue index a8844a4b4f2..4bfae779fe1 100644 --- a/src/components/Editor/MarkdownContentEditor.vue +++ b/src/components/Editor/MarkdownContentEditor.vue @@ -92,7 +92,7 @@ export default { created() { this.$editor = this.createEditor() - this.$editor.setOptions({ editable: !this.readOnly }) + this.$editor.setEditable(!this.readOnly) }, beforeDestroy() {