Merge pull request #15413 from calixteman/items_size
Set a display value for the secondary toolbar buttons
This commit is contained in:
commit
b0a021d2cc
@ -810,9 +810,7 @@ const PDFViewerApplication = {
|
|||||||
*/
|
*/
|
||||||
_hideViewBookmark() {
|
_hideViewBookmark() {
|
||||||
// URL does not reflect proper document location - hiding some buttons.
|
// URL does not reflect proper document location - hiding some buttons.
|
||||||
const { toolbar, secondaryToolbar } = this.appConfig;
|
this.appConfig.secondaryToolbar.viewBookmarkButton.hidden = true;
|
||||||
toolbar.viewBookmark.hidden = true;
|
|
||||||
secondaryToolbar.viewBookmarkButton.hidden = true;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2292,7 +2290,6 @@ function webViewerInitialized() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!PDFViewerApplication.supportsFullscreen) {
|
if (!PDFViewerApplication.supportsFullscreen) {
|
||||||
appConfig.toolbar.presentationModeButton.classList.add("hidden");
|
|
||||||
appConfig.secondaryToolbar.presentationModeButton.classList.add("hidden");
|
appConfig.secondaryToolbar.presentationModeButton.classList.add("hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2445,7 +2442,6 @@ function webViewerUpdateViewarea({ location }) {
|
|||||||
const href = PDFViewerApplication.pdfLinkService.getAnchorUrl(
|
const href = PDFViewerApplication.pdfLinkService.getAnchorUrl(
|
||||||
location.pdfOpenParams
|
location.pdfOpenParams
|
||||||
);
|
);
|
||||||
PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href;
|
|
||||||
PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href =
|
PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href =
|
||||||
href;
|
href;
|
||||||
|
|
||||||
|
@ -42,13 +42,9 @@ const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";
|
|||||||
* @property {HTMLButtonElement} zoomOut - Button to zoom out the pages.
|
* @property {HTMLButtonElement} zoomOut - Button to zoom out the pages.
|
||||||
* @property {HTMLButtonElement} viewFind - Button to open find bar.
|
* @property {HTMLButtonElement} viewFind - Button to open find bar.
|
||||||
* @property {HTMLButtonElement} openFile - Button to open a new document.
|
* @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
|
* @property {HTMLButtonElement} editorFreeTextButton - Button to switch to
|
||||||
* FreeText editing.
|
* FreeText editing.
|
||||||
* @property {HTMLButtonElement} download - Button to download the document.
|
* @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 {
|
class Toolbar {
|
||||||
@ -69,12 +65,7 @@ class Toolbar {
|
|||||||
{ element: options.zoomIn, eventName: "zoomin" },
|
{ element: options.zoomIn, eventName: "zoomin" },
|
||||||
{ element: options.zoomOut, eventName: "zoomout" },
|
{ element: options.zoomOut, eventName: "zoomout" },
|
||||||
{ element: options.print, eventName: "print" },
|
{ element: options.print, eventName: "print" },
|
||||||
{
|
|
||||||
element: options.presentationModeButton,
|
|
||||||
eventName: "presentationmode",
|
|
||||||
},
|
|
||||||
{ element: options.download, eventName: "download" },
|
{ element: options.download, eventName: "download" },
|
||||||
{ element: options.viewBookmark, eventName: null },
|
|
||||||
{
|
{
|
||||||
element: options.editorFreeTextButton,
|
element: options.editorFreeTextButton,
|
||||||
eventName: "switchannotationeditormode",
|
eventName: "switchannotationeditormode",
|
||||||
|
@ -882,8 +882,7 @@ select {
|
|||||||
mask-image: var(--toolbarButton-zoomIn-icon);
|
mask-image: var(--toolbarButton-zoomIn-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
#presentationMode::before,
|
#presentationMode::before {
|
||||||
#secondaryPresentationMode::before {
|
|
||||||
mask-image: var(--toolbarButton-presentationMode-icon);
|
mask-image: var(--toolbarButton-presentationMode-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -922,8 +921,7 @@ a.secondaryToolbarButton[href="#"] {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#viewBookmark::before,
|
#viewBookmark::before {
|
||||||
#secondaryViewBookmark::before {
|
|
||||||
mask-image: var(--toolbarButton-bookmark-icon);
|
mask-image: var(--toolbarButton-bookmark-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -979,6 +977,7 @@ a.secondaryToolbarButton[href="#"] {
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.secondaryToolbarButton > span {
|
.secondaryToolbarButton > span {
|
||||||
padding-inline-end: 4px;
|
padding-inline-end: 4px;
|
||||||
@ -1456,8 +1455,7 @@ dialog :link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.visibleLargeView,
|
.visibleLargeView,
|
||||||
.visibleMediumView,
|
.visibleMediumView {
|
||||||
.visibleSmallView {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1503,9 +1501,6 @@ dialog :link {
|
|||||||
.hiddenSmallView * {
|
.hiddenSmallView * {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.visibleSmallView {
|
|
||||||
display: inherit;
|
|
||||||
}
|
|
||||||
.toolbarButtonSpacer {
|
.toolbarButtonSpacer {
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
|
@ -180,29 +180,31 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
|
|
||||||
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
|
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
|
||||||
<div id="secondaryToolbarButtonContainer">
|
<div id="secondaryToolbarButtonContainer">
|
||||||
<button id="secondaryPresentationMode" class="secondaryToolbarButton visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode">
|
|
||||||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!--#if GENERIC-->
|
<!--#if GENERIC-->
|
||||||
<button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
|
<button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView" title="Open File" tabindex="51" data-l10n-id="open_file">
|
||||||
<span data-l10n-id="open_file_label">Open</span>
|
<span data-l10n-id="open_file_label">Open</span>
|
||||||
</button>
|
</button>
|
||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
|
|
||||||
<button id="secondaryPrint" class="secondaryToolbarButton visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
|
<button id="secondaryPrint" class="secondaryToolbarButton visibleMediumView" title="Print" tabindex="52" data-l10n-id="print">
|
||||||
<span data-l10n-id="print_label">Print</span>
|
<span data-l10n-id="print_label">Print</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="secondaryDownload" class="secondaryToolbarButton visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
|
<button id="secondaryDownload" class="secondaryToolbarButton visibleMediumView" title="Download" tabindex="53" data-l10n-id="download">
|
||||||
<span data-l10n-id="download_label">Download</span>
|
<span data-l10n-id="download_label">Download</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark">
|
<div class="horizontalToolbarSeparator visibleLargeView"></div>
|
||||||
|
|
||||||
|
<button id="presentationMode" class="secondaryToolbarButton" title="Switch to Presentation Mode" tabindex="54" data-l10n-id="presentation_mode">
|
||||||
|
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<a href="#" id="viewBookmark" class="secondaryToolbarButton" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark">
|
||||||
<span data-l10n-id="bookmark_label">Current View</span>
|
<span data-l10n-id="bookmark_label">Current View</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="horizontalToolbarSeparator visibleLargeView"></div>
|
<div class="horizontalToolbarSeparator"></div>
|
||||||
|
|
||||||
<button id="firstPage" class="secondaryToolbarButton" title="Go to First Page" tabindex="56" data-l10n-id="first_page">
|
<button id="firstPage" class="secondaryToolbarButton" title="Go to First Page" tabindex="56" data-l10n-id="first_page">
|
||||||
<span data-l10n-id="first_page_label">Go to First Page</span>
|
<span data-l10n-id="first_page_label">Go to First Page</span>
|
||||||
@ -294,34 +296,27 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
<span id="numPages" class="toolbarLabel"></span>
|
<span id="numPages" class="toolbarLabel"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="toolbarViewerRight">
|
<div id="toolbarViewerRight">
|
||||||
<button id="presentationMode" class="toolbarButton hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode">
|
|
||||||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!--#if GENERIC-->
|
<!--#if GENERIC-->
|
||||||
<button id="openFile" class="toolbarButton hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
|
<button id="openFile" class="toolbarButton hiddenLargeView" title="Open File" tabindex="31" data-l10n-id="open_file">
|
||||||
<span data-l10n-id="open_file_label">Open</span>
|
<span data-l10n-id="open_file_label">Open</span>
|
||||||
</button>
|
</button>
|
||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
|
|
||||||
<button id="print" class="toolbarButton hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
|
<button id="print" class="toolbarButton hiddenMediumView" title="Print" tabindex="32" data-l10n-id="print">
|
||||||
<span data-l10n-id="print_label">Print</span>
|
<span data-l10n-id="print_label">Print</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="download" class="toolbarButton hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
|
<button id="download" class="toolbarButton hiddenMediumView" title="Download" tabindex="33" data-l10n-id="download">
|
||||||
<span data-l10n-id="download_label">Download</span>
|
<span data-l10n-id="download_label">Download</span>
|
||||||
</button>
|
</button>
|
||||||
<a href="#" id="viewBookmark" class="toolbarButton hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark">
|
|
||||||
<span data-l10n-id="bookmark_label">Current View</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="verticalToolbarSeparator hiddenSmallView"></div>
|
<div class="verticalToolbarSeparator hiddenMediumView"></div>
|
||||||
|
|
||||||
<div id="editorModeButtons" class="splitToolbarButton toggled hidden" role="radiogroup">
|
<div id="editorModeButtons" class="splitToolbarButton toggled hidden" role="radiogroup">
|
||||||
<button id="editorFreeText" class="toolbarButton" disabled="disabled" title="Text" role="radio" aria-checked="false" tabindex="36" data-l10n-id="editor_free_text2">
|
<button id="editorFreeText" class="toolbarButton" disabled="disabled" title="Text" role="radio" aria-checked="false" tabindex="34" data-l10n-id="editor_free_text2">
|
||||||
<span data-l10n-id="editor_free_text2_label">Text</span>
|
<span data-l10n-id="editor_free_text2_label">Text</span>
|
||||||
</button>
|
</button>
|
||||||
<button id="editorInk" class="toolbarButton" disabled="disabled" title="Draw" role="radio" aria-checked="false" tabindex="37" data-l10n-id="editor_ink2">
|
<button id="editorInk" class="toolbarButton" disabled="disabled" title="Draw" role="radio" aria-checked="false" tabindex="35" data-l10n-id="editor_ink2">
|
||||||
<span data-l10n-id="editor_ink2_label">Draw</span>
|
<span data-l10n-id="editor_ink2_label">Draw</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -107,23 +107,19 @@ function getViewerConfiguration() {
|
|||||||
),
|
),
|
||||||
editorInkButton: document.getElementById("editorInk"),
|
editorInkButton: document.getElementById("editorInk"),
|
||||||
editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"),
|
editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"),
|
||||||
presentationModeButton: document.getElementById("presentationMode"),
|
|
||||||
download: document.getElementById("download"),
|
download: document.getElementById("download"),
|
||||||
viewBookmark: document.getElementById("viewBookmark"),
|
|
||||||
},
|
},
|
||||||
secondaryToolbar: {
|
secondaryToolbar: {
|
||||||
toolbar: document.getElementById("secondaryToolbar"),
|
toolbar: document.getElementById("secondaryToolbar"),
|
||||||
toggleButton: document.getElementById("secondaryToolbarToggle"),
|
toggleButton: document.getElementById("secondaryToolbarToggle"),
|
||||||
presentationModeButton: document.getElementById(
|
presentationModeButton: document.getElementById("presentationMode"),
|
||||||
"secondaryPresentationMode"
|
|
||||||
),
|
|
||||||
openFileButton:
|
openFileButton:
|
||||||
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
|
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
|
||||||
? document.getElementById("secondaryOpenFile")
|
? document.getElementById("secondaryOpenFile")
|
||||||
: null,
|
: null,
|
||||||
printButton: document.getElementById("secondaryPrint"),
|
printButton: document.getElementById("secondaryPrint"),
|
||||||
downloadButton: document.getElementById("secondaryDownload"),
|
downloadButton: document.getElementById("secondaryDownload"),
|
||||||
viewBookmarkButton: document.getElementById("secondaryViewBookmark"),
|
viewBookmarkButton: document.getElementById("viewBookmark"),
|
||||||
firstPageButton: document.getElementById("firstPage"),
|
firstPageButton: document.getElementById("firstPage"),
|
||||||
lastPageButton: document.getElementById("lastPage"),
|
lastPageButton: document.getElementById("lastPage"),
|
||||||
pageRotateCwButton: document.getElementById("pageRotateCw"),
|
pageRotateCwButton: document.getElementById("pageRotateCw"),
|
||||||
|
Loading…
Reference in New Issue
Block a user