From a1d106dc5d93d4fdd828d74ecdae050e741547cb Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 6 Mar 2022 15:36:32 +0100 Subject: [PATCH] Use proper private methods in `web/pdf_cursor_tools.js` --- web/pdf_cursor_tools.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/web/pdf_cursor_tools.js b/web/pdf_cursor_tools.js index 39cc532f7..b2a2ab2ba 100644 --- a/web/pdf_cursor_tools.js +++ b/web/pdf_cursor_tools.js @@ -46,7 +46,7 @@ class PDFCursorTools { element: this.container, }); - this._addEventListeners(); + this.#addEventListeners(); // Defer the initial `switchTool` call, to give other viewer components // time to initialize *and* register 'cursortoolchanged' event listeners. @@ -106,23 +106,17 @@ class PDFCursorTools { // in order to prevent setting it to an invalid state. this.active = tool; - this._dispatchEvent(); + this.#dispatchEvent(); } - /** - * @private - */ - _dispatchEvent() { + #dispatchEvent() { this.eventBus.dispatch("cursortoolchanged", { source: this, tool: this.active, }); } - /** - * @private - */ - _addEventListeners() { + #addEventListeners() { this.eventBus._on("switchcursortool", evt => { this.switchTool(evt.tool); });