From 865b3e0b21af5aa0fac71e93dc1a7635a1ae168c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 18 Jan 2012 23:50:21 -0500 Subject: [PATCH] Add progress indicator to add item by identifier --- chrome/content/zotero/lookup.js | 14 +++++++++++++- chrome/content/zotero/zoteroPane.xul | 7 +++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js index a43d04150..99984dfea 100644 --- a/chrome/content/zotero/lookup.js +++ b/chrome/content/zotero/lookup.js @@ -58,6 +58,9 @@ const Zotero_Lookup = new function () { translate.setTranslator(translators); translate.setHandler("done", function(translate, success) { + identifierElement.style.opacity = 1; + identifierElement.disabled = false; + document.getElementById("zotero-lookup-progress").hidden = true; if(success) { document.getElementById("zotero-lookup-panel").hidePopup(); } else { @@ -78,6 +81,10 @@ const Zotero_Lookup = new function () { if(collection) collection.addItem(item.id); }); + identifierElement.style.opacity = 0.5; + identifierElement.disabled = true; + document.getElementById("zotero-lookup-progress").hidden = false; + translate.translate(libraryID); return false; } @@ -102,7 +109,12 @@ const Zotero_Lookup = new function () { if(!Zotero.isFx4) { document.getElementById("zotero-lookup-panel").style.padding = "10px"; } - document.getElementById("zotero-lookup-textbox").focus(); + + document.getElementById("zotero-lookup-progress").hidden = false; + var identifierElement = document.getElementById("zotero-lookup-textbox"); + identifierElement.style.opacity = 1; + identifierElement.disabled = false; + identifierElement.focus(); } /** diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index 7aff1895d..1081ce51e 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -142,10 +142,13 @@ + onpopuphidden="Zotero_Lookup.onHidden()"> &zotero.lookup.description; - + +