Inline the Toolbar._localized
method in the 'localized' event handler
Considering just how small/simple this code is, it doesn't seem necessary to have a separate method for it (even more so when there's only one call-site).
This commit is contained in:
parent
eaa2e216f4
commit
07473e9e2a
@ -152,16 +152,12 @@ class Toolbar {
|
|||||||
scaleSelect.oncontextmenu = noContextMenuHandler;
|
scaleSelect.oncontextmenu = noContextMenuHandler;
|
||||||
|
|
||||||
this.eventBus.on('localized', () => {
|
this.eventBus.on('localized', () => {
|
||||||
this._localized();
|
this._wasLocalized = true;
|
||||||
|
this._adjustScaleWidth();
|
||||||
|
this._updateUIState(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_localized() {
|
|
||||||
this._wasLocalized = true;
|
|
||||||
this._adjustScaleWidth();
|
|
||||||
this._updateUIState(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
_updateUIState(resetNumPages = false) {
|
_updateUIState(resetNumPages = false) {
|
||||||
if (!this._wasLocalized) {
|
if (!this._wasLocalized) {
|
||||||
// Don't update the UI state until we localize the toolbar.
|
// Don't update the UI state until we localize the toolbar.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user