mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Move the reset
-calls to occur last in the toolbar-constructors
By invoking the `reset` methods *last* in the `Toolbar`/`SecondaryToolbar`-constructors, we ensure that the "toolbarreset"/"secondarytoolbarreset"-events are actually handle when the viewer loads. Note that previously those events were dispatched *before* the relevant event-listeners had been attached. With this small change we can avoid inconsistent initial toolbar-state, specifically in the case when the viewer is *reloaded* (since Firefox keeps the HTML-state on "soft" reloads).
This commit is contained in:
parent
2b0b8cd665
commit
047522a34a
2 changed files with 4 additions and 4 deletions
|
@ -111,10 +111,10 @@ class Toolbar {
|
|||
editorInkParamsToolbar: options.editorInkParamsToolbar,
|
||||
};
|
||||
|
||||
this.reset();
|
||||
|
||||
// Bind the event listeners for click and various other actions.
|
||||
this.#bindListeners(options);
|
||||
|
||||
this.reset();
|
||||
}
|
||||
|
||||
setPageNumber(pageNumber, pageLabel) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue