diff --git a/service.js b/service.js index 02817f1..b0a08e7 100644 --- a/service.js +++ b/service.js @@ -778,8 +778,8 @@ class BesCKService extends BesService { // Not a nice way to do it, but it works for now the repositionMistakes function is called before the DOM updates are finished. // If users will experience performance issues, we can consider debouncing this function. // The lagginess becomes noticeable if the text is long and has many grammar mistakes. - service.repositionMistakes() setTimeout(() => { + service.repositionMistakes() window.dispatchEvent(new Event('resize')) }, 100) service.timer = setTimeout(function () { @@ -805,6 +805,7 @@ class BesCKService extends BesService { this.proof(this.hostElement) }, 500) } + /** * This function disables the CKEditor spellcheck. * @@ -881,6 +882,13 @@ class BesCKService extends BesService { this.abortController = new AbortController() this.proofCKEditor() } + + setStatusDivPosition(hostElement, statusDiv) { + const hRects = hostElement.getBoundingClientRect() + const scrollTop = window.scrollY || document.documentElement.scrollTop + statusDiv.style.left = hRects.right - 50 + 'px' + statusDiv.style.top = hRects.top + hRects.height - 50 + scrollTop + 'px' + } } ///