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:
Jonas Jenwald 2018-07-08 10:55:56 +02:00
parent b39a2ba57a
commit 46e1d5daa4
2 changed files with 5 additions and 4 deletions

View file

@ -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);
});