Use proper private methods in web/pdf_cursor_tools.js
This commit is contained in:
parent
3ac2053d97
commit
a1d106dc5d
@ -46,7 +46,7 @@ class PDFCursorTools {
|
|||||||
element: this.container,
|
element: this.container,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._addEventListeners();
|
this.#addEventListeners();
|
||||||
|
|
||||||
// Defer the initial `switchTool` call, to give other viewer components
|
// Defer the initial `switchTool` call, to give other viewer components
|
||||||
// time to initialize *and* register 'cursortoolchanged' event listeners.
|
// time to initialize *and* register 'cursortoolchanged' event listeners.
|
||||||
@ -106,23 +106,17 @@ class PDFCursorTools {
|
|||||||
// in order to prevent setting it to an invalid state.
|
// in order to prevent setting it to an invalid state.
|
||||||
this.active = tool;
|
this.active = tool;
|
||||||
|
|
||||||
this._dispatchEvent();
|
this.#dispatchEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#dispatchEvent() {
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
_dispatchEvent() {
|
|
||||||
this.eventBus.dispatch("cursortoolchanged", {
|
this.eventBus.dispatch("cursortoolchanged", {
|
||||||
source: this,
|
source: this,
|
||||||
tool: this.active,
|
tool: this.active,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#addEventListeners() {
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
_addEventListeners() {
|
|
||||||
this.eventBus._on("switchcursortool", evt => {
|
this.eventBus._on("switchcursortool", evt => {
|
||||||
this.switchTool(evt.tool);
|
this.switchTool(evt.tool);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user