Skip to content

Commit a251b99

Browse files
committed
Make the 'add file' button not hidden but just not visible in order to fix the layout
The feature will be plugged later.
1 parent 2bab2a8 commit a251b99

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
@@ -245,10 +245,11 @@
245245
flex: 0 0 auto;
246246

247247
.viewsManagerLabel {
248-
flex: 1 0 0;
248+
flex: 0;
249249
color: var(--text-color);
250250
text-align: center;
251251
height: fit-content;
252+
width: fit-content;
252253
user-select: none;
253254

254255
font: menu;
@@ -336,6 +337,8 @@
336337
}
337338

338339
#viewsManagerAddFileButton {
340+
visibility: hidden;
341+
339342
background: var(--button-no-bg);
340343
width: 32px;
341344
height: 32px;

web/views_manager.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class ViewsManager extends Sidebar {
8686
outlinesView,
8787
attachmentsView,
8888
layersView,
89+
viewsManagerAddFileButton,
8990
viewsManagerCurrentOutlineButton,
9091
viewsManagerSelectorButton,
9192
viewsManagerSelectorOptions,
@@ -131,6 +132,7 @@ class ViewsManager extends Sidebar {
131132
this.attachmentsView = attachmentsView;
132133
this.layersView = layersView;
133134

135+
this.viewsManagerAddFileButton = viewsManagerAddFileButton;
134136
this.viewsManagerCurrentOutlineButton = viewsManagerCurrentOutlineButton;
135137
this.viewsManagerHeaderLabel = viewsManagerHeaderLabel;
136138
this.viewsManagerStatus = viewsManagerStatus;
@@ -248,6 +250,7 @@ class ViewsManager extends Sidebar {
248250
}
249251

250252
this.viewsManagerStatus.hidden = view !== SidebarView.THUMBS;
253+
this.viewsManagerAddFileButton.hidden = view !== SidebarView.THUMBS;
251254
this.viewsManagerCurrentOutlineButton.hidden = view !== SidebarView.OUTLINE;
252255
this.viewsManagerHeaderLabel.setAttribute(
253256
"data-l10n-id",

0 commit comments

Comments
 (0)