diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index 1c9af0f8b..c0291fea8 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -671,7 +671,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(); diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index fdc35e074..3fcd91b6a 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -167,12 +167,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"]); } } diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index a1f638dde..1033eb12b 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1441,7 +1441,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); * @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;