From b8b1f8be553e5c18a4164eddedd77ae8d3a4dae6 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 11 Apr 2022 13:12:43 -0700 Subject: [PATCH] Disable Import actions in uneditable libraries (#2471) --- chrome/content/zotero/zoteroPane.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index bfb9f3c0ca..0dc43549bc 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1294,8 +1294,8 @@ var ZoteroPane = new function() if (this.itemsView && this.itemsView.collectionTreeRow && this.itemsView.collectionTreeRow.id == collectionTreeRow.id) { Zotero.debug("ZoteroPane.onCollectionSelected: Collection selection hasn't changed"); - // Update toolbar, in case editability has changed - this._updateToolbarIconsForRow(collectionTreeRow); + // Update enabled actions, in case editability has changed + this._updateEnabledActionsForRow(collectionTreeRow); return; } @@ -1315,7 +1315,7 @@ var ZoteroPane = new function() collectionTreeRow.setTags(ZoteroPane.tagSelector.getTagSelection()); } - this._updateToolbarIconsForRow(collectionTreeRow); + this._updateEnabledActionsForRow(collectionTreeRow); // If item data not yet loaded for library, load it now. // Other data types are loaded at startup @@ -1336,12 +1336,14 @@ var ZoteroPane = new function() /** - * Enable or disable toolbar icons and menu options as necessary + * Enable or disable toolbar icons, menu options, and commands as necessary */ - this._updateToolbarIconsForRow = function (collectionTreeRow) { + this._updateEnabledActionsForRow = function (collectionTreeRow) { const disableIfNoEdit = [ "cmd_zotero_newCollection", "cmd_zotero_newSavedSearch", + "cmd_zotero_import", + "cmd_zotero_importFromClipboard", "zotero-tb-add", "menu_newItem", "zotero-tb-lookup",