Don't show sidenav Expand/Collapse button in library view

This commit is contained in:
Abe Jellinek 2024-01-02 11:57:20 -08:00 committed by Dan Stillman
parent 0facc521b2
commit d62c9e217b

View file

@ -153,6 +153,11 @@
this.render();
}
get _showCollapseButton() {
// Only show in reader
return !!this._contextNotesPane;
}
get _collapsed() {
let collapsible = this.container.closest('splitter:not([hidden="true"]) + *');
return collapsible.getAttribute('collapsed') === 'true';
@ -349,8 +354,14 @@
continue;
}
else if (pane == 'toggle-collapse') {
let hidden = !this._showCollapseButton;
toolbarbutton.parentElement.hidden = hidden;
toolbarbutton.parentElement.nextElementSibling.hidden = hidden; // Divider
toolbarbutton.setAttribute('data-l10n-id', 'sidenav-' + (this._collapsed ? 'expand' : 'collapse'));
toolbarbutton.classList.toggle('collapsed', this._collapsed);
continue;
}