From e56c30eb59f302b450deebaab68242a84a17722e Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Sat, 3 Sep 2022 16:17:22 +0200 Subject: [PATCH] Move 'presentation mode' and 'bookmarks' buttons in the secondary toolbar (bug 1789082) --- web/app.js | 6 +----- web/toolbar.js | 9 --------- web/viewer.css | 6 ++---- web/viewer.html | 39 +++++++++++++++++---------------------- web/viewer.js | 8 ++------ 5 files changed, 22 insertions(+), 46 deletions(-) diff --git a/web/app.js b/web/app.js index 986caeed192a1..e22bf8646f3a1 100644 --- a/web/app.js +++ b/web/app.js @@ -811,9 +811,7 @@ const PDFViewerApplication = { */ _hideViewBookmark() { // URL does not reflect proper document location - hiding some buttons. - const { toolbar, secondaryToolbar } = this.appConfig; - toolbar.viewBookmark.hidden = true; - secondaryToolbar.viewBookmarkButton.hidden = true; + this.appConfig.secondaryToolbar.viewBookmarkButton.hidden = true; }, /** @@ -2337,7 +2335,6 @@ function webViewerInitialized() { } if (!PDFViewerApplication.supportsFullscreen) { - appConfig.toolbar.presentationModeButton.classList.add("hidden"); appConfig.secondaryToolbar.presentationModeButton.classList.add("hidden"); } @@ -2490,7 +2487,6 @@ function webViewerUpdateViewarea({ location }) { const href = PDFViewerApplication.pdfLinkService.getAnchorUrl( location.pdfOpenParams ); - PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href; PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = href; diff --git a/web/toolbar.js b/web/toolbar.js index 183d072d82ace..c03eaea8e0c5c 100644 --- a/web/toolbar.js +++ b/web/toolbar.js @@ -42,13 +42,9 @@ const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading"; * @property {HTMLButtonElement} zoomOut - Button to zoom out the pages. * @property {HTMLButtonElement} viewFind - Button to open find bar. * @property {HTMLButtonElement} openFile - Button to open a new document. - * @property {HTMLButtonElement} presentationModeButton - Button to switch to - * presentation mode. * @property {HTMLButtonElement} editorFreeTextButton - Button to switch to * FreeText editing. * @property {HTMLButtonElement} download - Button to download the document. - * @property {HTMLAnchorElement} viewBookmark - Button to obtain a bookmark link - * to the current location in the document. */ class Toolbar { @@ -69,12 +65,7 @@ class Toolbar { { element: options.zoomIn, eventName: "zoomin" }, { element: options.zoomOut, eventName: "zoomout" }, { element: options.print, eventName: "print" }, - { - element: options.presentationModeButton, - eventName: "presentationmode", - }, { element: options.download, eventName: "download" }, - { element: options.viewBookmark, eventName: null }, { element: options.editorFreeTextButton, eventName: "switchannotationeditormode", diff --git a/web/viewer.css b/web/viewer.css index 8fe1e7d807baa..11a3bec33d5cc 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -882,8 +882,7 @@ select { mask-image: var(--toolbarButton-zoomIn-icon); } -#presentationMode::before, -#secondaryPresentationMode::before { +#presentationMode::before { mask-image: var(--toolbarButton-presentationMode-icon); } @@ -922,8 +921,7 @@ a.secondaryToolbarButton[href="#"] { pointer-events: none; } -#viewBookmark::before, -#secondaryViewBookmark::before { +#viewBookmark::before { mask-image: var(--toolbarButton-bookmark-icon); } diff --git a/web/viewer.html b/web/viewer.html index 34005799566c7..e6880f23546ee 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -180,29 +180,31 @@