From 223bfe74dba6a2acd9515cc2df1eeba9fcc38fc8 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 2 Oct 2011 23:28:38 +0000 Subject: [PATCH] Disable toolbar buttons in collections that cannot be edited --- chrome/content/zotero-platform/mac/overlay.css | 4 ++-- chrome/content/zotero/zoteroPane.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index 6ebaacf7e9..298a9216e9 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -36,7 +36,7 @@ } .zotero-tb-button[open="true"], -.zotero-tb-button:hover:active { +.zotero-tb-button:not([disabled="true"]):hover:active { background: url("chrome://zotero/skin/mac/menubutton-end-pressed.png") right center no-repeat; } @@ -69,7 +69,7 @@ } .zotero-tb-button[open="true"] > .toolbarbutton-icon, -.zotero-tb-button:hover:active > .toolbarbutton-icon { +.zotero-tb-button:not([disabled="true"]):hover:active > .toolbarbutton-icon { background: url("chrome://zotero/skin/mac/menubutton-start-pressed.png") left center no-repeat; } diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 19d6d9642e..5a6c897726 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1062,6 +1062,19 @@ var ZoteroPane = new function() itemgroup.setSearch(''); itemgroup.setTags(getTagSelection()); + // Enable or disable toolbar icons as necessary + const disableIfNoEdit = ["cmd_zotero_newCollection", "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