From 04a3dc65e47315fb32ef274a6275edfb5e3d0713 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 10 Aug 2019 15:38:33 +0200 Subject: [PATCH 1/2] Move the sidebar `toggleButton` event listener into `PDFSidebar` This is consistent with other functionality, such as e.g. `SecondaryToolbar` and `PDFFindBar`. --- web/app.js | 4 ---- web/pdf_sidebar.js | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app.js b/web/app.js index 40ec6796a..4581cc1e0 100644 --- a/web/app.js +++ b/web/app.js @@ -1654,10 +1654,6 @@ function webViewerInitialized() { } }, true); - appConfig.sidebar.toggleButton.addEventListener('click', function() { - PDFViewerApplication.pdfSidebar.toggle(); - }); - try { webViewerOpenFileViaURL(file); } catch (reason) { diff --git a/web/pdf_sidebar.js b/web/pdf_sidebar.js index 4e2ef24f6..5b39cf5bf 100644 --- a/web/pdf_sidebar.js +++ b/web/pdf_sidebar.js @@ -390,6 +390,10 @@ class PDFSidebar { } }); + this.toggleButton.addEventListener('click', () => { + this.toggle(); + }); + // Buttons for switching views. this.thumbnailButton.addEventListener('click', () => { this.switchView(SidebarView.THUMBS); From 446ce88f81523945ec8bd08d19465717cac66f72 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 10 Aug 2019 15:40:33 +0200 Subject: [PATCH 2/2] Remove the non-`PRODUCTION` only 'disablebcmaps' hash parameter This was added in PR 4470, but doesn't appear to have been used since. While it's certainly easy to understand how this was helpful during development of that PR, actually providing this hash parameter isn't going to work anymore given that the original CMap files were also removed from the repository. I suppose that the hash parameter *could* be useful if you'd attempt to update the BCMap files, however that hasn't been attempted even once in over *five* years time. Furthermore, at this point using the `AppOptions` directly in that situation should also work fine. All in all, this seems like a piece of old and unused code which we can simply remove now. --- web/app.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/web/app.js b/web/app.js index 4581cc1e0..832dc1be4 100644 --- a/web/app.js +++ b/web/app.js @@ -236,11 +236,6 @@ let PDFViewerApplication = { if ('verbosity' in hashParams) { AppOptions.set('verbosity', hashParams['verbosity'] | 0); } - if ((typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) && - hashParams['disablebcmaps'] === 'true') { - AppOptions.set('cMapUrl', '../external/cmaps/'); - AppOptions.set('cMapPacked', false); - } if ('textlayer' in hashParams) { switch (hashParams['textlayer']) { case 'off':