summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-07-06 11:10:26 +0200
committerThomas Bruederli <thomas@roundcube.net>2012-07-06 12:56:42 +0200
commit8fdb332a20fec1988a6ec76fc83c3a4eb28ed1c8 (patch)
tree6e4bc3551ec85ccfb6b135c5fadeeabbbfd1d01d
parent969ff01ac8f1712540f4f05d116618b028c7af27 (diff)
Fix connection error alerts when page unloads (#1488547)
-rw-r--r--CHANGELOG1
-rw-r--r--program/js/app.js6
2 files changed, 7 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 268baa7e9..e3b3949de 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix 'no connection' errors on page unloads (#1488547)
- Plugin API: Add 'unauthenticated' hook (#1488138)
- Show explicit error message when provided hostname is invalid (#1488550)
- Fix wrong compose screen elements focus in IE9 (#1488541)
diff --git a/program/js/app.js b/program/js/app.js
index 8d02f6f39..ae9f4e972 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -60,6 +60,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)
{
@@ -6129,6 +6131,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')