diff options
author | Aleksander Machniak <alec@alec.pl> | 2015-04-10 09:46:21 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2015-04-10 09:46:21 +0200 |
commit | e8e88d347d99dacfe6e34713a52e412561fcfadd (patch) | |
tree | ff744c5cdecfb990f6ca8f2d1ce682b864722bbc | |
parent | d86ff983393db7d059b205903585f2d3ebc0cb4f (diff) |
Fix bug where forced extwin page reload could exit from the extwin mode (#1490350)
With small improvements in rcube_webmail.url() method.
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | program/js/app.js | 16 |
2 files changed, 12 insertions, 5 deletions
@@ -16,6 +16,7 @@ CHANGELOG Roundcube Webmail - Fix so unrecognized TNEF attachments are displayed on the list of attachments (#1490351) - Fix lack of signature separator for plain text signatures in html mode (#1490352) - Fix font artifact in Google Chrome on Windows (#1490353) +- Fix bug where forced extwin page reload could exit from the extwin mode (#1490350) RELEASE 1.1.1 ------------- diff --git a/program/js/app.js b/program/js/app.js index 1da2a8173..64fd548c9 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1440,7 +1440,7 @@ function rcube_webmail() else if (delay) setTimeout(function() { ref.reload(); }, delay); else if (window.location) - location.href = this.env.comm_path + (this.env.action ? '&_action='+this.env.action : ''); + location.href = this.url('', {_extwin: this.env.extwin}); }; // Add variable to GET string, replace old value if exists @@ -7222,7 +7222,7 @@ function rcube_webmail() // compose a valid url with the given parameters this.url = function(action, query) { - var querystring = typeof query === 'string' ? '&' + query : ''; + var querystring = typeof query === 'string' ? query : ''; if (typeof action !== 'string') query = action; @@ -7234,12 +7234,12 @@ function rcube_webmail() else if (this.env.action) query._action = this.env.action; - var base = this.env.comm_path, k, param = {}; + var url = this.env.comm_path, k, param = {}; // overwrite task name if (action && action.match(/([a-z0-9_-]+)\/([a-z0-9-_.]+)/)) { query._action = RegExp.$2; - base = base.replace(/\_task=[a-z0-9_-]+/, '_task='+RegExp.$1); + url = url.replace(/\_task=[a-z0-9_-]+/, '_task=' + RegExp.$1); } // remove undefined values @@ -7248,7 +7248,13 @@ function rcube_webmail() param[k] = query[k]; } - return base + (base.indexOf('?') > -1 ? '&' : '?') + $.param(param) + querystring; + if (param = $.param(param)) + url += (url.indexOf('?') > -1 ? '&' : '?') + param; + + if (querystring) + url += (url.indexOf('?') > -1 ? '&' : '?') + querystring; + + return url; }; this.redirect = function(url, lock) |