Disable Import actions in uneditable libraries (#2471)
This commit is contained in:
parent
ad36c9fb2a
commit
b8b1f8be55
1 changed files with 7 additions and 5 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue