mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-11 17:45:49 +02:00
Make the 'add file' button not hidden but just not visible in order to fix the layout
The feature will be plugged later.
This commit is contained in:
parent
2bab2a87a4
commit
a251b99e2b
@ -604,6 +604,7 @@ const PDFViewerApplication = {
|
|||||||
enableHWA,
|
enableHWA,
|
||||||
enableSplitMerge: AppOptions.get("enableSplitMerge"),
|
enableSplitMerge: AppOptions.get("enableSplitMerge"),
|
||||||
manageMenu: appConfig.viewsManager.manageMenu,
|
manageMenu: appConfig.viewsManager.manageMenu,
|
||||||
|
addFileButton: appConfig.viewsManager.viewsManagerAddFileButton,
|
||||||
});
|
});
|
||||||
renderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
|
renderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,8 @@ const SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT = 15;
|
|||||||
* The default value is `false`.
|
* The default value is `false`.
|
||||||
* @property {Object} [manageMenu] - The menu elements to manage saving edited
|
* @property {Object} [manageMenu] - The menu elements to manage saving edited
|
||||||
* PDF.
|
* PDF.
|
||||||
*/
|
* @property {HTMLButtonElement} addFileButton - The button that opens a dialog
|
||||||
|
* to add a PDF file to merge with the current one.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Viewer control to display thumbnails for pages in a PDF document.
|
* Viewer control to display thumbnails for pages in a PDF document.
|
||||||
@ -141,6 +142,7 @@ class PDFThumbnailViewer {
|
|||||||
enableHWA,
|
enableHWA,
|
||||||
enableSplitMerge,
|
enableSplitMerge,
|
||||||
manageMenu,
|
manageMenu,
|
||||||
|
addFileButton,
|
||||||
}) {
|
}) {
|
||||||
this.scrollableContainer = container.parentElement;
|
this.scrollableContainer = container.parentElement;
|
||||||
this.container = container;
|
this.container = container;
|
||||||
@ -152,6 +154,8 @@ class PDFThumbnailViewer {
|
|||||||
this.pageColors = pageColors || null;
|
this.pageColors = pageColors || null;
|
||||||
this.enableHWA = enableHWA || false;
|
this.enableHWA = enableHWA || false;
|
||||||
this.#enableSplitMerge = enableSplitMerge || false;
|
this.#enableSplitMerge = enableSplitMerge || false;
|
||||||
|
// TODO: uncomment when the "add file" feature is implemented.
|
||||||
|
// this.#addFileButton = addFileButton;
|
||||||
|
|
||||||
if (this.#enableSplitMerge && manageMenu) {
|
if (this.#enableSplitMerge && manageMenu) {
|
||||||
const { button, menu, copy, cut, delete: del, saveAs } = manageMenu;
|
const { button, menu, copy, cut, delete: del, saveAs } = manageMenu;
|
||||||
|
|||||||
@ -245,10 +245,11 @@
|
|||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
||||||
.viewsManagerLabel {
|
.viewsManagerLabel {
|
||||||
flex: 1 0 0;
|
flex: 0;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
|
width: fit-content;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
font: menu;
|
font: menu;
|
||||||
@ -336,6 +337,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#viewsManagerAddFileButton {
|
#viewsManagerAddFileButton {
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
background: var(--button-no-bg);
|
background: var(--button-no-bg);
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
|||||||
@ -86,6 +86,7 @@ class ViewsManager extends Sidebar {
|
|||||||
outlinesView,
|
outlinesView,
|
||||||
attachmentsView,
|
attachmentsView,
|
||||||
layersView,
|
layersView,
|
||||||
|
viewsManagerAddFileButton,
|
||||||
viewsManagerCurrentOutlineButton,
|
viewsManagerCurrentOutlineButton,
|
||||||
viewsManagerSelectorButton,
|
viewsManagerSelectorButton,
|
||||||
viewsManagerSelectorOptions,
|
viewsManagerSelectorOptions,
|
||||||
@ -131,6 +132,7 @@ class ViewsManager extends Sidebar {
|
|||||||
this.attachmentsView = attachmentsView;
|
this.attachmentsView = attachmentsView;
|
||||||
this.layersView = layersView;
|
this.layersView = layersView;
|
||||||
|
|
||||||
|
this.viewsManagerAddFileButton = viewsManagerAddFileButton;
|
||||||
this.viewsManagerCurrentOutlineButton = viewsManagerCurrentOutlineButton;
|
this.viewsManagerCurrentOutlineButton = viewsManagerCurrentOutlineButton;
|
||||||
this.viewsManagerHeaderLabel = viewsManagerHeaderLabel;
|
this.viewsManagerHeaderLabel = viewsManagerHeaderLabel;
|
||||||
this.viewsManagerStatus = viewsManagerStatus;
|
this.viewsManagerStatus = viewsManagerStatus;
|
||||||
@ -248,6 +250,7 @@ class ViewsManager extends Sidebar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.viewsManagerStatus.hidden = view !== SidebarView.THUMBS;
|
this.viewsManagerStatus.hidden = view !== SidebarView.THUMBS;
|
||||||
|
this.viewsManagerAddFileButton.hidden = view !== SidebarView.THUMBS;
|
||||||
this.viewsManagerCurrentOutlineButton.hidden = view !== SidebarView.OUTLINE;
|
this.viewsManagerCurrentOutlineButton.hidden = view !== SidebarView.OUTLINE;
|
||||||
this.viewsManagerHeaderLabel.setAttribute(
|
this.viewsManagerHeaderLabel.setAttribute(
|
||||||
"data-l10n-id",
|
"data-l10n-id",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user