- Don't display browser content context menu submenu if empty
- Disable submenu options if in read-only mode
This commit is contained in:
parent
4f9d39614b
commit
84b87b6455
1 changed files with 8 additions and 2 deletions
|
@ -2222,10 +2222,16 @@ var ZoteroPane = new function()
|
|||
}
|
||||
}
|
||||
|
||||
// If Zotero is locked, disable menu items
|
||||
// If Zotero is locked or library is read-only, disable menu items
|
||||
var menu = document.getElementById('zotero-content-area-context-menu');
|
||||
menu.hidden = !showing;
|
||||
var disabled = Zotero.locked;
|
||||
if (!disabled && self.collectionsView.selection && self.collectionsView.selection.count) {
|
||||
var itemGroup = self.collectionsView._getItemAtRow(self.collectionsView.selection.currentIndex);
|
||||
disabled = !itemGroup.isEditable()
|
||||
}
|
||||
for each(var menuitem in menu.firstChild.childNodes) {
|
||||
menuitem.disabled = Zotero.locked;
|
||||
menuitem.disabled = disabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue