mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-26 16:42:44 +00:00
Monotone-Parent: 52144e5b0340281632f7e7aadc9ca155bba27c61
Monotone-Revision: e2123af89707f4bc2b9f980dfef0f57731970142 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-06T18:22:49 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2010-08-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/generic.js: (AjaxRequestsChain): new class
|
||||
that implements the chaining of ajax requests.
|
||||
|
||||
* UI/WebServerResources/MailerUI.js: (dropAction): ensure that the
|
||||
destination mailbox is in the same mail account as the message
|
||||
being dragged.
|
||||
|
||||
@@ -318,6 +318,44 @@ function triggerAjaxRequest(url, callback, userdata, content, headers) {
|
||||
return http;
|
||||
}
|
||||
|
||||
function AjaxRequestsChain(callback, callbackData) {
|
||||
this.requests = [];
|
||||
this.counter = 0;
|
||||
this.callback = callback;
|
||||
this.callbackData = callbackData;
|
||||
}
|
||||
|
||||
AjaxRequestsChain.prototype = {
|
||||
requests: null,
|
||||
counter: 0,
|
||||
callback: null,
|
||||
callbackData: null,
|
||||
|
||||
_step: function ARC__step() {
|
||||
if (this.counter < this.requests.length) {
|
||||
var request = this.requests[this.counter];
|
||||
this.counter++;
|
||||
var chain = this;
|
||||
var origCallback = request[1];
|
||||
request[1] = function ARC__step_callback(http) {
|
||||
if (origCallback) {
|
||||
http.callback = origCallback;
|
||||
origCallback.apply(http, [http]);
|
||||
}
|
||||
chain._step();
|
||||
};
|
||||
triggerAjaxRequest.apply(window, request);
|
||||
}
|
||||
else {
|
||||
this.callback.apply(this, [this.callbackData]);
|
||||
}
|
||||
},
|
||||
|
||||
start: function ARC_start() {
|
||||
this._step();
|
||||
}
|
||||
};
|
||||
|
||||
function startAnimation(parent, nextNode) {
|
||||
var anim = $("progressIndicator");
|
||||
if (!anim) {
|
||||
|
||||
Reference in New Issue
Block a user