From 6784df431c77d7550c78c925540fa342f9bf6c97 Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Wed, 22 May 2024 13:36:08 +0200 Subject: [PATCH] Eliminate unnecessary setTimeout function from CKEditor's class, since it is no longer needed --- service2.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/service2.js b/service2.js index 020574e..a3d6773 100644 --- a/service2.js +++ b/service2.js @@ -812,18 +812,12 @@ class BesCKService extends BesTreeService { this.clearProofing(domElement) } - // TODO: Research if input event or any other event that is called *after* the change is completed - // is possible with CKEditor, and move the code below this line there. - setTimeout(() => { - // Now that the text is done changing, we can correctly calculate markup position. - this.repositionAllMarkup() - - // Defer grammar-checking to reduce stress on grammar-checking server. - this.timer = setTimeout(() => { - this.proofAll() - delete this.timer - }, 1000) - }, 0) + this.repositionAllMarkup() + // Defer grammar-checking to reduce stress on grammar-checking server. + this.timer = setTimeout(() => { + this.proofAll() + delete this.timer + }, 1000) } /**