- Don't display browser content context menu submenu if empty

- Disable submenu options if in read-only mode
This commit is contained in:
Dan Stillman 2009-08-10 00:58:01 +00:00
parent 4f9d39614b
commit 84b87b6455

View file

@ -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;
}
}