From 84b87b64556dff127639675296c37363300bd470 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 10 Aug 2009 00:58:01 +0000 Subject: [PATCH] - Don't display browser content context menu submenu if empty - Disable submenu options if in read-only mode --- chrome/content/zotero/overlay.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 17508a25e8..e71482ac31 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -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; } }