From 5ed444f5776f418de8c2ee24c0fb4f6bfcc8be6e Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Mon, 22 Apr 2024 07:57:30 +0200 Subject: [PATCH] Improve CKEditor plugin listeners logic --- service.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/service.js b/service.js index ce94220..2fd1f07 100644 --- a/service.js +++ b/service.js @@ -692,10 +692,10 @@ class BesCKService extends BesService { } }) this.ckEditorInstance.commands.get('undo').on('execute', () => { - this.handlePluginChanges() + this.proofCKEditor() }) this.ckEditorInstance.commands.get('redo').on('execute', () => { - this.handlePluginChanges() + this.proofCKEditor() }) this.ckEditorInstance.commands.get('bold').on('execute', () => { setTimeout(() => { @@ -710,16 +710,16 @@ class BesCKService extends BesService { }, 500) }) this.ckEditorInstance.commands.get('indent').on('execute', () => { - this.handlePluginChanges() + this.proofCKEditor() }) this.ckEditorInstance.commands.get('outdent').on('execute', () => { - this.handlePluginChanges() + this.proofCKEditor() }) this.ckEditorInstance.commands.get('numberedList').on('execute', () => { - this.handlePluginChanges() + this.proofCKEditor() }) this.ckEditorInstance.commands.get('bulletedList').on('execute', () => { - this.handlePluginChanges() + this.proofCKEditor() }) } @@ -777,7 +777,7 @@ class BesCKService extends BesService { this.children = [] } - handlePluginChanges() { + proofCKEditor() { this.clearAllMistakes(this.scrollPanel) this.clearChildren() setTimeout(() => { @@ -858,7 +858,7 @@ class BesCKService extends BesService { // It maintains reasonable performance as it only checks the block element that has been modified, // rather than re-evaluating the entire document or a larger set of elements. this.abortController = new AbortController() - this.proof(el) + this.proofCKEditor() } }