mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Simplify resetting of the SecondaryToolbar
Scroll/Spread mode buttons, and add a missing comment in PDFCursorTools
The names 'resetscrollmode'/'resetspreadmode' were probably *not* great choices, given that the only thing being reset are toolbar buttons and not the actual Scroll/Spread modes. Furthermore, there's really no need for two separate events here. The patch also adds a comment that ought to have been included in PR 9040, to prevent future refactoring/removing of what may appear to be an unnecessary `Promise.resolve` call.
This commit is contained in:
parent
b39a2ba57a
commit
46e1d5daa4
2 changed files with 5 additions and 4 deletions
|
@ -47,6 +47,8 @@ class PDFCursorTools {
|
|||
|
||||
this._addEventListeners();
|
||||
|
||||
// Defer the initial `switchTool` call, to give other viewer components
|
||||
// time to initialize *and* register 'cursortoolchanged' event listeners.
|
||||
Promise.resolve().then(() => {
|
||||
this.switchTool(cursorToolOnLoad);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue