www

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

commit 814b15c23a9db8437b1057ed83f404217d0e9592
parent 1475a79cd1450a71de927550faf6e45709677a74
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu,  8 Mar 2012 14:47:29 -0500

Don't let translators try to load the current document a second time

Diffstat:
Mchrome/content/zotero/xpcom/utilities_translate.js | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/utilities_translate.js b/chrome/content/zotero/xpcom/utilities_translate.js @@ -241,6 +241,17 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor } } + for(var i=0; i<urls.length; i++) { + if("document" in this._translate && "location" in this._translate.document + && this._translate.document.location.toString() === urls[i]) { + // Document is attempting to reload itself + Zotero.debug("Translate: Attempted to load the current document using processDocuments; using loaded document instead"); + processor(this._translate.document, urls[i]); + urls.splice(i, 1); + i--; + } + } + translate.incrementAsyncProcesses("Zotero.Utilities.Translate#processDocuments"); var hiddenBrowser = Zotero.HTTP.processDocuments(urls, function(doc) { if(!processor) return;