diff --git a/chrome/content/zotero/elements/collapsibleSection.js b/chrome/content/zotero/elements/collapsibleSection.js index 3fca675447..5dc7ca7a46 100644 --- a/chrome/content/zotero/elements/collapsibleSection.js +++ b/chrome/content/zotero/elements/collapsibleSection.js @@ -285,8 +285,12 @@ }); } + get _disableCollapsing() { + return !!this.closest('panel, menupopup'); + } + _handleClick = (event) => { - if (!this._getSidenav()) return; + if (this._disableCollapsing) return; if (event.target.closest('.section-custom-button, menupopup')) return; this.open = !this.open; }; @@ -373,7 +377,11 @@ _getSidenav() { // If we're inside a popup, the main window sidenav is irrelevant - if (this.closest('popup, menupopup')) { + if (this.closest('panel, menupopup')) { + return null; + } + // If we're not in the main window, we don't have a sidenav + if (document.documentElement.getAttribute('windowtype') !== 'navigator:browser') { return null; } // TODO: update this after unifying item pane & context pane @@ -395,7 +403,7 @@ this._head.setAttribute('aria-expanded', this.open); this._title.textContent = this.label; - this._head.querySelector('.twisty').hidden = !this._getSidenav(); + this._head.querySelector('.twisty').hidden = this._disableCollapsing; } } customElements.define("collapsible-section", CollapsibleSection); diff --git a/chrome/content/zotero/note.xhtml b/chrome/content/zotero/note.xhtml index 543d30edff..d1a56d4f76 100644 --- a/chrome/content/zotero/note.xhtml +++ b/chrome/content/zotero/note.xhtml @@ -23,6 +23,8 @@ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); Services.scriptloader.loadSubScript("chrome://zotero/content/include.js", this); Services.scriptloader.loadSubScript("resource://zotero/require.js", this); + Services.scriptloader.loadSubScript("chrome://global/content/globalOverlay.js", this); + Services.scriptloader.loadSubScript("chrome://zotero/content/editMenuOverlay.js", this); Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this); Services.scriptloader.loadSubScript("chrome://zotero/content/note.js", this);