From 07473e9e2a84b86902972b2f0dbd654aa71ee911 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 17 Nov 2019 14:02:33 +0100 Subject: [PATCH] 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). --- web/toolbar.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/web/toolbar.js b/web/toolbar.js index 089c6c3f6..70330af09 100644 --- a/web/toolbar.js +++ b/web/toolbar.js @@ -152,16 +152,12 @@ class Toolbar { scaleSelect.oncontextmenu = noContextMenuHandler; 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) { if (!this._wasLocalized) { // Don't update the UI state until we localize the toolbar.