From 5b367b6ac148afed897c5febb6e1886c214ef65a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 5 Mar 2013 15:35:15 -0500 Subject: [PATCH] Tweaks to name-swapping menu - Don't show menu if item isn't editable - Make DOM access more robust - Fix whitespace --- chrome/content/zotero/bindings/itembox.xml | 71 ++++++++++------------ 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 51d339909..b462bcb11 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -712,7 +712,6 @@ // Name var firstlast = document.createElement("hbox"); - firstlast.setAttribute("context", "creator-transform-menu"); firstlast.className = 'creator-name-box'; firstlast.setAttribute("flex","1"); var tabindex = this._tabIndexMinCreators + (this._creatorCount * 2); @@ -742,6 +741,11 @@ if (creator.fieldMode) { firstlast.lastChild.setAttribute('hidden', true); } + + if (this.editable) { + firstlast.setAttribute('contextmenu', 'zotero-creator-transform-menu'); + } + this._tabIndexMaxCreators = Math.max(this._tabIndexMaxCreators, tabindex); hbox.appendChild(firstlast); @@ -2215,23 +2219,20 @@ - - - - - + + + @@ -2501,27 +2502,19 @@ - - - - + +