Fix cancel button in WebDAV verification
This commit is contained in:
parent
6c28e61032
commit
6e9167aef1
2 changed files with 10 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -1290,11 +1290,12 @@ Zotero.Sync.Storage.WebDAV = (function () {
|
|||
return deferred.resolve([uri, Zotero.Sync.Storage.ERROR_OFFLINE]);
|
||||
}
|
||||
|
||||
// Pass request to progress handler
|
||||
// Pass XMLHttpRequest to progress handler
|
||||
setTimeout(function () {
|
||||
var obj = {};
|
||||
obj.request = request;
|
||||
obj.xmlhttp = request;
|
||||
deferred.notify(obj)
|
||||
|
||||
}, 0);
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue