Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the "Open file"-button from the main toolbar #17244

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions web/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";
* @property {HTMLButtonElement} zoomIn - Button to zoom in the pages.
* @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} editorFreeTextButton - Button to switch to
* FreeText editing.
* @property {HTMLButtonElement} download - Button to download the document.
Expand Down Expand Up @@ -97,9 +96,6 @@ class Toolbar {
},
},
];
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
this.buttons.push({ element: options.openFile, eventName: "openfile" });
}
this.items = {
numPages: options.numPages,
pageNumber: options.pageNumber,
Expand Down
15 changes: 2 additions & 13 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -919,13 +919,12 @@ body {
mask-image: var(--toolbarButton-editorStamp-icon);
}

#print::before,
#secondaryPrint::before {
:is(#print, #secondaryPrint)::before {
mask-image: var(--toolbarButton-print-icon);
}

/*#if GENERIC*/
:is(#openFile, #secondaryOpenFile)::before {
#secondaryOpenFile::before {
mask-image: var(--toolbarButton-openFile-icon);
}
/*#endif*/
Expand Down Expand Up @@ -1435,7 +1434,6 @@ dialog :link {
}
}

.visibleLargeView,
.visibleMediumView {
display: none;
}
Expand All @@ -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) {
#outerContainer .hiddenMediumView {
display: none;
Expand Down
10 changes: 2 additions & 8 deletions web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
<div id="secondaryToolbarButtonContainer">
<!--#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>
</button>
<!--#endif-->
Expand All @@ -224,7 +224,7 @@
</button>

<!--#if GENERIC-->
<div class="horizontalToolbarSeparator visibleLargeView"></div>
<div class="horizontalToolbarSeparator"></div>
<!--#else-->
<!-- <div class="horizontalToolbarSeparator visibleMediumView"></div>-->
<!--#endif-->
Expand Down Expand Up @@ -329,12 +329,6 @@
<span id="numPages" class="toolbarLabel"></span>
</div>
<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">
<span data-l10n-id="pdfjs-print-button-label">Print</span>
</button>
Expand Down
4 changes: 0 additions & 4 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ function getViewerConfiguration() {
zoomIn: document.getElementById("zoomIn"),
zoomOut: document.getElementById("zoomOut"),
viewFind: document.getElementById("viewFind"),
openFile:
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
? document.getElementById("openFile")
: null,
print: document.getElementById("print"),
editorFreeTextButton: document.getElementById("editorFreeText"),
editorFreeTextParamsToolbar: document.getElementById(
Expand Down