mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-03 04:47:21 +02:00
Merge pull request #20748 from calixteman/add_file_button
Make the 'add file' button not hidden but just not visible in order to fix the layout
This commit is contained in:
commit
45b0f8b05e
@ -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;
|
||||||
|
|||||||
@ -247,10 +247,11 @@
|
|||||||
background-color: var(--header-bg);
|
background-color: var(--header-bg);
|
||||||
|
|
||||||
.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;
|
||||||
@ -338,6 +339,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#viewsManagerAddFileButton {
|
#viewsManagerAddFileButton {
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
background: var(--button-no-bg);
|
background: var(--button-no-bg);
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
|||||||
@ -89,6 +89,7 @@ class ViewsManager extends Sidebar {
|
|||||||
outlinesView,
|
outlinesView,
|
||||||
attachmentsView,
|
attachmentsView,
|
||||||
layersView,
|
layersView,
|
||||||
|
viewsManagerAddFileButton,
|
||||||
viewsManagerCurrentOutlineButton,
|
viewsManagerCurrentOutlineButton,
|
||||||
viewsManagerSelectorButton,
|
viewsManagerSelectorButton,
|
||||||
viewsManagerSelectorOptions,
|
viewsManagerSelectorOptions,
|
||||||
@ -134,6 +135,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;
|
||||||
@ -251,6 +253,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