Skip to content

Commit 45b0f8b

Browse files
authored
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
2 parents 123ed24 + a251b99 commit 45b0f8b

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

web/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ const PDFViewerApplication = {
604604
enableHWA,
605605
enableSplitMerge: AppOptions.get("enableSplitMerge"),
606606
manageMenu: appConfig.viewsManager.manageMenu,
607+
addFileButton: appConfig.viewsManager.viewsManagerAddFileButton,
607608
});
608609
renderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
609610
}

web/pdf_thumbnail_viewer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ const SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT = 15;
7070
* The default value is `false`.
7171
* @property {Object} [manageMenu] - The menu elements to manage saving edited
7272
* PDF.
73-
*/
73+
* @property {HTMLButtonElement} addFileButton - The button that opens a dialog
74+
* to add a PDF file to merge with the current one.
7475
7576
/**
7677
* Viewer control to display thumbnails for pages in a PDF document.
@@ -141,6 +142,7 @@ class PDFThumbnailViewer {
141142
enableHWA,
142143
enableSplitMerge,
143144
manageMenu,
145+
addFileButton,
144146
}) {
145147
this.scrollableContainer = container.parentElement;
146148
this.container = container;
@@ -152,6 +154,8 @@ class PDFThumbnailViewer {
152154
this.pageColors = pageColors || null;
153155
this.enableHWA = enableHWA || false;
154156
this.#enableSplitMerge = enableSplitMerge || false;
157+
// TODO: uncomment when the "add file" feature is implemented.
158+
// this.#addFileButton = addFileButton;
155159

156160
if (this.#enableSplitMerge && manageMenu) {
157161
const { button, menu, copy, cut, delete: del, saveAs } = manageMenu;

web/views_manager.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,11 @@
247247
background-color: var(--header-bg);
248248

249249
.viewsManagerLabel {
250-
flex: 1 0 0;
250+
flex: 0;
251251
color: var(--text-color);
252252
text-align: center;
253253
height: fit-content;
254+
width: fit-content;
254255
user-select: none;
255256

256257
font: menu;
@@ -338,6 +339,8 @@
338339
}
339340

340341
#viewsManagerAddFileButton {
342+
visibility: hidden;
343+
341344
background: var(--button-no-bg);
342345
width: 32px;
343346
height: 32px;

web/views_manager.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class ViewsManager extends Sidebar {
8989
outlinesView,
9090
attachmentsView,
9191
layersView,
92+
viewsManagerAddFileButton,
9293
viewsManagerCurrentOutlineButton,
9394
viewsManagerSelectorButton,
9495
viewsManagerSelectorOptions,
@@ -134,6 +135,7 @@ class ViewsManager extends Sidebar {
134135
this.attachmentsView = attachmentsView;
135136
this.layersView = layersView;
136137

138+
this.viewsManagerAddFileButton = viewsManagerAddFileButton;
137139
this.viewsManagerCurrentOutlineButton = viewsManagerCurrentOutlineButton;
138140
this.viewsManagerHeaderLabel = viewsManagerHeaderLabel;
139141
this.viewsManagerStatus = viewsManagerStatus;
@@ -251,6 +253,7 @@ class ViewsManager extends Sidebar {
251253
}
252254

253255
this.viewsManagerStatus.hidden = view !== SidebarView.THUMBS;
256+
this.viewsManagerAddFileButton.hidden = view !== SidebarView.THUMBS;
254257
this.viewsManagerCurrentOutlineButton.hidden = view !== SidebarView.OUTLINE;
255258
this.viewsManagerHeaderLabel.setAttribute(
256259
"data-l10n-id",

0 commit comments

Comments
 (0)