From 9599d1712cd0aeebe54dbf25409b6eecb24fc2cd Mon Sep 17 00:00:00 2001 From: abaevbog Date: Tue, 18 Jul 2023 00:40:19 -0700 Subject: [PATCH] disable file > close for library if 1+ tabs open (#3210) When there are multiple tabs opened, menuitem File > Close is disabled for the library tab. Fixes: #3198 --- chrome/content/zotero/tabs.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 9ab43f28f4..70e487d638 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -83,6 +83,9 @@ var Zotero_Tabs = new function () { selected: tab.id == this._selectedID, iconBackgroundImage: tab.iconBackgroundImage }))); + // Disable File > Close menuitem if multiple tabs are open + const multipleTabsOpen = this._tabs.length > 1; + document.getElementById('cmd_close').setAttribute('disabled', multipleTabsOpen); var { tab } = this._getTab(this._selectedID); document.title = (tab.title.length ? tab.title + ' - ' : '') + Zotero.appName; this._updateTabBar();