diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-07-06 11:10:26 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-07-06 11:10:26 +0200 |
commit | 7794ae1387c1f96d0e7a3e73e3fb3729649f1621 (patch) | |
tree | 1f83b29765904b62378fcbc4252e1da77d8159d0 /program/js | |
parent | ef5f7fb13c437496467da0ea29e32bb5750da507 (diff) |
Fix connection error alerts when page unloads (#1488547)
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js index a2307fd77..ca77a8dc4 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -58,6 +58,8 @@ function rcube_webmail() beforeSend: function(xmlhttp){ xmlhttp.setRequestHeader('X-Roundcube-Request', ref.env.request_token); } }); + $(window).bind('beforeunload', function() { rcmail.unload = true; }); + // set environment variable(s) this.set_env = function(p, value) { @@ -6168,6 +6170,10 @@ function rcube_webmail() this.set_busy(false, null, lock); request.abort(); + // don't display error message on page unload (#1488547) + if (this.unload) + return; + if (request.status && errmsg) this.display_message(this.get_label('servererror') + ' (' + errmsg + ')', 'error'); else if (status == 'timeout') |