www

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

commit 6e9167aef10312827e8ea160ec9390d01c3038ce
parent 6c28e610328f599024455cdc5eb65d3905a24aed
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 19 Feb 2013 06:10:57 -0500

Fix cancel button in WebDAV verification

Diffstat:
Mchrome/content/zotero/preferences/preferences.js | 7++++---
Mchrome/content/zotero/xpcom/storage/webdav.js | 11++++++-----
2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js @@ -375,6 +375,10 @@ function verifyStorageServer() { var onDone = false; Zotero.Sync.Storage.WebDAV.checkServer() + // Get the XMLHttpRequest for possible cancelling + .progress(function (obj) { + request = obj.xmlhttp; + }) .finally(function () { verifyButton.hidden = false; abortButton.hidden = true; @@ -426,9 +430,6 @@ function verifyStorageServer() { } } }) - .progress(function (obj) { - request = obj.request; - }) .catch(function (e) { Zotero.debug("WebDAV verification failed"); Zotero.debug(e, 1); diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js @@ -1290,11 +1290,12 @@ Zotero.Sync.Storage.WebDAV = (function () { return deferred.resolve([uri, Zotero.Sync.Storage.ERROR_OFFLINE]); } - // Pass request to progress handler - var obj = {}; - obj.request = request; - deferred.notify(obj) - + // Pass XMLHttpRequest to progress handler + setTimeout(function () { + var obj = {}; + obj.xmlhttp = request; + deferred.notify(obj) + }, 0); return deferred.promise; };