www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 63e07763d77e236c3f8a50e282155c0160b43d43
parent f18b13e8823093afb09805c4aa279cd5c80bc164
Author: Simon Kornblith <simon@simonster.com>
Date:   Fri,  1 Jul 2011 17:25:26 +0000

More refinements for select handlers that do not use a callback


Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -388,9 +388,17 @@ Zotero.Translate.Sandbox = { haveAsyncHandler = !callbackExecuted; } + Zotero.debug("Translate: "+(haveAsyncHandler ? "" : "don't")+" have async handler"); + Zotero.debug("Translate: "+(haveAsyncHandler ? "" : "don't")+" have async callback"); + if(haveAsyncCallback) { - // we are running asynchronously, so increment async processes - if(haveAsyncHandler) translate.incrementAsyncProcesses(); + if(haveAsyncHandler) { + // we are running asynchronously, so increment async processes + translate.incrementAsyncProcesses(); + } else if(!callbackExecuted) { + // callback didn't get called from handler, so call it here + callback(returnedItems); + } return false; } else { translate._debug("Translate: COMPAT WARNING: No callback was provided for "+