From 8fdb332a20fec1988a6ec76fc83c3a4eb28ed1c8 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 6 Jul 2012 11:10:26 +0200 Subject: Fix connection error alerts when page unloads (#1488547) --- program/js/app.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'program/js/app.js') 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') -- cgit v1.2.3