Disable "New Saved Search" menu option in read-only libraries
This commit is contained in:
parent
d63d24c636
commit
4966a55a1b
|
@ -1063,10 +1063,17 @@ var ZoteroPane = new function()
|
||||||
itemgroup.setSearch('');
|
itemgroup.setSearch('');
|
||||||
itemgroup.setTags(getTagSelection());
|
itemgroup.setTags(getTagSelection());
|
||||||
|
|
||||||
// Enable or disable toolbar icons as necessary
|
// Enable or disable toolbar icons and menu options as necessary
|
||||||
const disableIfNoEdit = ["cmd_zotero_newCollection", "zotero-tb-add",
|
const disableIfNoEdit = [
|
||||||
"cmd_zotero_newItemFromCurrentPage", "zotero-tb-lookup", "cmd_zotero_newStandaloneNote",
|
"cmd_zotero_newCollection",
|
||||||
"zotero-tb-note-add", "zotero-tb-attachment-add"];
|
"cmd_zotero_newSavedSearch",
|
||||||
|
"zotero-tb-add",
|
||||||
|
"cmd_zotero_newItemFromCurrentPage",
|
||||||
|
"zotero-tb-lookup",
|
||||||
|
"cmd_zotero_newStandaloneNote",
|
||||||
|
"zotero-tb-note-add",
|
||||||
|
"zotero-tb-attachment-add"
|
||||||
|
];
|
||||||
for(var i=0; i<disableIfNoEdit.length; i++) {
|
for(var i=0; i<disableIfNoEdit.length; i++) {
|
||||||
var el = document.getElementById(disableIfNoEdit[i]);
|
var el = document.getElementById(disableIfNoEdit[i]);
|
||||||
if(itemgroup.editable) {
|
if(itemgroup.editable) {
|
||||||
|
@ -2123,7 +2130,9 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable some actions if user doesn't have write access
|
// Disable some actions if user doesn't have write access
|
||||||
var s = [m.editSelectedCollection, m.removeCollection, m.newCollection, m.newSavedSearch, m.newSubcollection];
|
//
|
||||||
|
// Some actions are disabled via their commands in onCollectionSelected()
|
||||||
|
var s = [m.newSubcollection, m.editSelectedCollection, m.removeCollection, m.emptyTrash];
|
||||||
if (itemGroup.isWithinGroup() && !itemGroup.editable && !itemGroup.isDuplicates() && !itemGroup.isUnfiled()) {
|
if (itemGroup.isWithinGroup() && !itemGroup.editable && !itemGroup.isDuplicates() && !itemGroup.isUnfiled()) {
|
||||||
disable = disable.concat(s);
|
disable = disable.concat(s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,6 +236,7 @@
|
||||||
|
|
||||||
<popupset>
|
<popupset>
|
||||||
<menupopup id="zotero-collectionmenu" onpopupshowing="ZoteroPane_Local.buildCollectionContextMenu();">
|
<menupopup id="zotero-collectionmenu" onpopupshowing="ZoteroPane_Local.buildCollectionContextMenu();">
|
||||||
|
<!-- Keep order in sync with buildCollectionContextMenu -->
|
||||||
<menuitem label="&zotero.toolbar.newCollection.label;" command="cmd_zotero_newCollection"/>
|
<menuitem label="&zotero.toolbar.newCollection.label;" command="cmd_zotero_newCollection"/>
|
||||||
<menuitem label="&zotero.toolbar.newSavedSearch.label;" command="cmd_zotero_newSavedSearch"/>
|
<menuitem label="&zotero.toolbar.newSavedSearch.label;" command="cmd_zotero_newSavedSearch"/>
|
||||||
<menuitem label="&zotero.toolbar.newSubcollection.label;" oncommand="ZoteroPane_Local.newCollection(ZoteroPane_Local.getSelectedCollection().id)"/>
|
<menuitem label="&zotero.toolbar.newSubcollection.label;" oncommand="ZoteroPane_Local.newCollection(ZoteroPane_Local.getSelectedCollection().id)"/>
|
||||||
|
@ -254,6 +255,7 @@
|
||||||
<menuitem label="Refresh" oncommand="ZoteroPane_Local.refreshCommonsBucket();"/><!--TODO localize -->
|
<menuitem label="Refresh" oncommand="ZoteroPane_Local.refreshCommonsBucket();"/><!--TODO localize -->
|
||||||
</menupopup>
|
</menupopup>
|
||||||
<menupopup id="zotero-itemmenu" onpopupshowing="ZoteroPane_Local.buildItemContextMenu();">
|
<menupopup id="zotero-itemmenu" onpopupshowing="ZoteroPane_Local.buildItemContextMenu();">
|
||||||
|
<!-- Keep order in sync with buildItemContextMenu -->
|
||||||
<menuitem label="&zotero.items.menu.showInLibrary;" oncommand="ZoteroPane_Local.selectItem(this.parentNode.getAttribute('itemID'), true)"/>
|
<menuitem label="&zotero.items.menu.showInLibrary;" oncommand="ZoteroPane_Local.selectItem(this.parentNode.getAttribute('itemID'), true)"/>
|
||||||
<menuseparator/>
|
<menuseparator/>
|
||||||
<!-- with icon: <menuitem class="menuitem-iconic" id="zotero-menuitem-note" label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane_Local.newNote(false, this.parentNode.getAttribute('itemID'))"/>-->
|
<!-- with icon: <menuitem class="menuitem-iconic" id="zotero-menuitem-note" label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane_Local.newNote(false, this.parentNode.getAttribute('itemID'))"/>-->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user