From ee33da22e8aa0cdbf359d5407efdcc23f7648516 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Sun, 20 Jan 2013 19:15:42 -0600 Subject: [PATCH 1/3] Set default handlers if they are not set (even if some other handlers are set). --- .../content/zotero/xpcom/translation/translate.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index c450b607e..4f96bb485 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -179,12 +179,13 @@ Zotero.Translate.Sandbox = { */ "loadTranslator":function(translate, type) { const setDefaultHandlers = function(translate, translation) { - if(Zotero.Utilities.isEmpty(translation._handlers)) { - if(type !== "export") { - translation.setHandler("itemDone", function(obj, item) { - translate.Sandbox._itemDone(translate, item); - }); - } + if(type !== "export" + && (!translation._handlers['itemDone'] || !translation._handlers['itemDone'].length)) { + translation.setHandler("itemDone", function(obj, item) { + translate.Sandbox._itemDone(translate, item); + }); + } + if(!translation._handlers['selectItems'] || !translation._handlers['selectItems'].length) { translation.setHandler("selectItems", translate._handlers["selectItems"]); } } From 502f814fc4a28d092a67aa9179b2e6c44aea2f9f Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 21 Jan 2013 04:06:25 -0500 Subject: [PATCH 2/3] Use Zotero.wait() to move progress indicator This may help with #230 --- chrome/content/zotero/fileInterface.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index a4c63e513..5b81786f5 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -639,7 +639,7 @@ var Zotero_File_Interface = new function() { .redraw(); // Process redraw event - Zotero.mainThread.processNextEvent(false); + Zotero.wait(0); } finally { // Close nested event queue if(eventQueuePushed) Zotero.mainThread.popEventQueue(); From 0e79cf247c9a3203870745a6a09003b8fb9a3f47 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 21 Jan 2013 13:29:26 -0500 Subject: [PATCH 3/3] Only set timeout to 50 if undefined --- chrome/content/zotero/xpcom/zotero.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 30cc02f2f..a8064121f 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1454,7 +1454,7 @@ const ZOTERO_CONFIG = { * @param {Integer} [timeout=50] Maximum number of milliseconds to wait */ this.wait = function (timeout) { - if (!timeout) { + if (timeout === undefined) { timeout = 50; } var mainThread = Zotero.mainThread;