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

Toggle the visibility of the outlineOptionsContainer, in the sidebar, using only CSS #17441

Merged
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
9 changes: 0 additions & 9 deletions web/pdf_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";
* the attachments are placed.
* @property {HTMLDivElement} layersView - The container in which
* the layers are placed.
* @property {HTMLDivElement} outlineOptionsContainer - The container in which
* the outline view-specific option button(s) are placed.
* @property {HTMLButtonElement} currentOutlineItemButton - The button used to
* find the current outline item.
*/
Expand Down Expand Up @@ -107,7 +105,6 @@ class PDFSidebar {
this.attachmentsView = elements.attachmentsView;
this.layersView = elements.layersView;

this._outlineOptionsContainer = elements.outlineOptionsContainer;
this._currentOutlineItemButton = elements.currentOutlineItemButton;

this.eventBus = eventBus;
Expand Down Expand Up @@ -227,12 +224,6 @@ class PDFSidebar {
this.layersView
);

// Finally, update view-specific CSS classes.
this._outlineOptionsContainer.classList.toggle(
"hidden",
view !== SidebarView.OUTLINE
);

if (forceOpen && !this.isOpen) {
this.open();
return; // Opening will trigger rendering and dispatch the event.
Expand Down
8 changes: 8 additions & 0 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,14 @@ a:focus > .thumbnail > .thumbnailImage,
color: var(--treeitem-hover-color);
}

#outlineOptionsContainer {
display: none;

#sidebarContainer:has(#outlineView:not(.hidden)) & {
display: inherit;
}
}

.dialogButton {
width: auto;
margin: 3px 4px 2px !important;
Expand Down
2 changes: 1 addition & 1 deletion web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</div>

<div id="toolbarSidebarRight">
<div id="outlineOptionsContainer" class="hidden">
<div id="outlineOptionsContainer">
<div class="verticalToolbarSeparator"></div>

<button id="currentOutlineItem" class="toolbarButton" disabled="disabled" title="Find Current Outline Item" tabindex="6" data-l10n-id="pdfjs-current-outline-item-button">
Expand Down
3 changes: 0 additions & 3 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ function getViewerConfiguration() {
attachmentsView: document.getElementById("attachmentsView"),
layersView: document.getElementById("layersView"),
// View-specific options
outlineOptionsContainer: document.getElementById(
"outlineOptionsContainer"
),
currentOutlineItemButton: document.getElementById("currentOutlineItem"),
},
findBar: {
Expand Down