Remove the "Open file"-button from the main toolbar
This button is *only* used in the GENERIC viewer, and will currently be visible either in the main or secondary toolbars (depending on the viewer width). To simplify upcoming changes, and to avoid then having to complicate the relevant CSS rules unnecessarily, let's place the "Open file"-button permanently in the secondary toolbar instead. (Note that the GENERIC viewer also, since five years, supports drag-and-drop in order to open local files.)
This commit is contained in:
parent
42f3d57365
commit
bf016743fc
@ -39,7 +39,6 @@ const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";
|
|||||||
* @property {HTMLButtonElement} zoomIn - Button to zoom in the pages.
|
* @property {HTMLButtonElement} zoomIn - Button to zoom in the pages.
|
||||||
* @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} 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.
|
||||||
@ -97,9 +96,6 @@ class Toolbar {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|
||||||
this.buttons.push({ element: options.openFile, eventName: "openfile" });
|
|
||||||
}
|
|
||||||
this.items = {
|
this.items = {
|
||||||
numPages: options.numPages,
|
numPages: options.numPages,
|
||||||
pageNumber: options.pageNumber,
|
pageNumber: options.pageNumber,
|
||||||
|
@ -919,13 +919,12 @@ body {
|
|||||||
mask-image: var(--toolbarButton-editorStamp-icon);
|
mask-image: var(--toolbarButton-editorStamp-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
#print::before,
|
:is(#print, #secondaryPrint)::before {
|
||||||
#secondaryPrint::before {
|
|
||||||
mask-image: var(--toolbarButton-print-icon);
|
mask-image: var(--toolbarButton-print-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#if GENERIC*/
|
/*#if GENERIC*/
|
||||||
:is(#openFile, #secondaryOpenFile)::before {
|
#secondaryOpenFile::before {
|
||||||
mask-image: var(--toolbarButton-openFile-icon);
|
mask-image: var(--toolbarButton-openFile-icon);
|
||||||
}
|
}
|
||||||
/*#endif*/
|
/*#endif*/
|
||||||
@ -1435,7 +1434,6 @@ dialog :link {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.visibleLargeView,
|
|
||||||
.visibleMediumView {
|
.visibleMediumView {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -1459,15 +1457,6 @@ dialog :link {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 820px) {
|
|
||||||
#outerContainer .hiddenLargeView {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#outerContainer .visibleLargeView {
|
|
||||||
display: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media all and (max-width: 750px) {
|
@media all and (max-width: 750px) {
|
||||||
#outerContainer .hiddenMediumView {
|
#outerContainer .hiddenMediumView {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -210,7 +210,7 @@ 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">
|
||||||
<!--#if GENERIC-->
|
<!--#if GENERIC-->
|
||||||
<button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView" title="Open File" tabindex="51" data-l10n-id="pdfjs-open-file-button">
|
<button id="secondaryOpenFile" class="secondaryToolbarButton" title="Open File" tabindex="51" data-l10n-id="pdfjs-open-file-button">
|
||||||
<span data-l10n-id="pdfjs-open-file-button-label">Open</span>
|
<span data-l10n-id="pdfjs-open-file-button-label">Open</span>
|
||||||
</button>
|
</button>
|
||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
@ -224,7 +224,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!--#if GENERIC-->
|
<!--#if GENERIC-->
|
||||||
<div class="horizontalToolbarSeparator visibleLargeView"></div>
|
<div class="horizontalToolbarSeparator"></div>
|
||||||
<!--#else-->
|
<!--#else-->
|
||||||
<!-- <div class="horizontalToolbarSeparator visibleMediumView"></div>-->
|
<!-- <div class="horizontalToolbarSeparator visibleMediumView"></div>-->
|
||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
@ -329,12 +329,6 @@ 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">
|
||||||
<!--#if GENERIC-->
|
|
||||||
<button id="openFile" class="toolbarButton hiddenLargeView" title="Open File" tabindex="31" data-l10n-id="pdfjs-open-file-button">
|
|
||||||
<span data-l10n-id="pdfjs-open-file-button-label">Open</span>
|
|
||||||
</button>
|
|
||||||
<!--#endif-->
|
|
||||||
|
|
||||||
<button id="print" class="toolbarButton hiddenMediumView" title="Print" tabindex="32" data-l10n-id="pdfjs-print-button">
|
<button id="print" class="toolbarButton hiddenMediumView" title="Print" tabindex="32" data-l10n-id="pdfjs-print-button">
|
||||||
<span data-l10n-id="pdfjs-print-button-label">Print</span>
|
<span data-l10n-id="pdfjs-print-button-label">Print</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -52,10 +52,6 @@ function getViewerConfiguration() {
|
|||||||
zoomIn: document.getElementById("zoomIn"),
|
zoomIn: document.getElementById("zoomIn"),
|
||||||
zoomOut: document.getElementById("zoomOut"),
|
zoomOut: document.getElementById("zoomOut"),
|
||||||
viewFind: document.getElementById("viewFind"),
|
viewFind: document.getElementById("viewFind"),
|
||||||
openFile:
|
|
||||||
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
|
|
||||||
? document.getElementById("openFile")
|
|
||||||
: null,
|
|
||||||
print: document.getElementById("print"),
|
print: document.getElementById("print"),
|
||||||
editorFreeTextButton: document.getElementById("editorFreeText"),
|
editorFreeTextButton: document.getElementById("editorFreeText"),
|
||||||
editorFreeTextParamsToolbar: document.getElementById(
|
editorFreeTextParamsToolbar: document.getElementById(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user