summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-08-04 08:12:36 +0000
committeralecpl <alec@alec.pl>2011-08-04 08:12:36 +0000
commitd9615118f3b14e65fc8214318d5bc50ebe19eb03 (patch)
treed2c068b11bccdbf8ba5c697a46b704548f6ca621
parentdb0408a2b8ceb0c8956f1ad41aae0752da6e1f14 (diff)
- Add abort_request() function
-rw-r--r--program/js/app.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 66cae80d0..62e0fb0a7 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3434,10 +3434,8 @@ function rcube_webmail()
if (this.gui_objects.qsearchbox)
this.gui_objects.qsearchbox.value = '';
- if (this.env.qsearch) {
- this.set_busy(this.env.qsearch.lock, false);
- this.env.qsearch.request.abort();
- }
+ if (this.env.qsearch)
+ this.abort_request(this.env.qsearch);
this.env.qsearch = null;
this.env.search_request = null;
@@ -3760,10 +3758,8 @@ function rcube_webmail()
if (!ac)
return;
- for (i=0, len=ac.locks.length; i<len; i++) {
- this.hide_message(ac.locks[i]); // hide loading message
- ac.requests[i].abort(); // abort ajax request
- }
+ for (i=0, len=ac.locks.length; i<len; i++)
+ this.abort_request({request: ac.requests[i], lock: ac.locks[i]});
this.ksearch_data = null;
}
@@ -5664,6 +5660,15 @@ function rcube_webmail()
});
};
+ // aborts ajax request
+ this.abort_request = function(r)
+ {
+ if (r.request)
+ r.request.abort();
+ if (r.lock)
+ this.set_busy(r.lock, false);
+ };
+
// handle HTTP response
this.http_response = function(response)
{