From 5d421964e5078476ae94eafb540759b49ff299b4 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 5 Oct 2018 10:17:37 +0200 Subject: [PATCH] Remove the unused `mainContainer` parameter from the `Toolbar` constructor Looking at the history of this code, this parameter has never been used. I'm guessing that most likely the code in `web/toolbar.js` began life as a copy of `web/secondary_toolbar.js`, which would probably explain why that parameter exists. --- web/app.js | 7 +++---- web/toolbar.js | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/web/app.js b/web/app.js index 9264ca1145434..91fcfc9a1235f 100644 --- a/web/app.js +++ b/web/app.js @@ -311,8 +311,8 @@ let PDFViewerApplication = { }); this.findController = findController; - let container = appConfig.mainContainer; - let viewer = appConfig.viewerContainer; + const container = appConfig.mainContainer; + const viewer = appConfig.viewerContainer; this.pdfViewer = new PDFViewer({ container, viewer, @@ -361,8 +361,7 @@ let PDFViewerApplication = { cursorToolOnLoad: AppOptions.get('cursorToolOnLoad'), }); - this.toolbar = new Toolbar(appConfig.toolbar, container, eventBus, - this.l10n); + this.toolbar = new Toolbar(appConfig.toolbar, eventBus, this.l10n); this.secondaryToolbar = new SecondaryToolbar(appConfig.secondaryToolbar, container, eventBus); diff --git a/web/toolbar.js b/web/toolbar.js index 986f638f40458..831cc5a0212c4 100644 --- a/web/toolbar.js +++ b/web/toolbar.js @@ -49,13 +49,11 @@ const SCALE_SELECT_PADDING = 22; class Toolbar { /** * @param {ToolbarOptions} options - * @param {HTMLDivElement} mainContainer * @param {EventBus} eventBus * @param {IL10n} l10n - Localization service. */ - constructor(options, mainContainer, eventBus, l10n = NullL10n) { + constructor(options, eventBus, l10n = NullL10n) { this.toolbar = options.container; - this.mainContainer = mainContainer; this.eventBus = eventBus; this.l10n = l10n; this.items = options;