From 53fc05a2f8d1f972d20f8a2463313d079864d12f Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Thu, 27 Feb 2025 09:28:40 +0100 Subject: [PATCH] Rename popupCorrectionPanel to preparePopup and update parameter names for clarity --- service.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/service.js b/service.js index 9eed155..6a327f7 100644 --- a/service.js +++ b/service.js @@ -676,17 +676,16 @@ class BesService { } /** - * Displays correction panel. + * Prepares and displays popup. * - * @param {*} el Block element/paragraph containing grammar checking rule match - * @param {*} match Grammar checking rule match + * @param {*} elMatch Array containing block element/paragraph containing grammar checking rule match and a match * @param {PointerEvent} source Click event source */ - popupCorrectionPanel(pointsInRect, source) { + preparePopup(elMatch, source) { this.dismissPopup() const popup = document.querySelector('bes-popup-el') BesPopup.clearReplacements() - pointsInRect.forEach(({ el, match }) => { + elMatch.forEach(({ el, match }) => { popup.setContent(el, match, this, this.isContentEditable()) this.highlightMistake(match) }) @@ -1133,7 +1132,7 @@ class BesTreeService extends BesService { } } this.dismissPopup() - if (pointsInRect.length) this.popupCorrectionPanel(pointsInRect, source) + if (pointsInRect.length) this.preparePopup(pointsInRect, source) } } @@ -1797,7 +1796,7 @@ class BesPlainTextService extends BesService { } } this.dismissPopup() - if (pointsInRect.length) this.popupCorrectionPanel(pointsInRect, source) + if (pointsInRect.length) this.preparePopup(pointsInRect, source) } /**