From d62c9e217b87f1b7fd135098632ea7ed16bbc002 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 2 Jan 2024 11:57:20 -0800 Subject: [PATCH] Don't show sidenav Expand/Collapse button in library view --- chrome/content/zotero/elements/itemPaneSidenav.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chrome/content/zotero/elements/itemPaneSidenav.js b/chrome/content/zotero/elements/itemPaneSidenav.js index b158a8a914..2de28f0017 100644 --- a/chrome/content/zotero/elements/itemPaneSidenav.js +++ b/chrome/content/zotero/elements/itemPaneSidenav.js @@ -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; }