diff options
-rw-r--r-- | program/js/app.js | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/program/js/app.js b/program/js/app.js index 868919cbd..308088612 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4521,16 +4521,23 @@ function rcube_webmail() type = type ? type : 'notice'; var ref = this, + key = msg, date = new Date(), id = type + date.getTime(), - timeout = type == 'loading' ? this.env.request_timeout * 1000 : (this.message_time * (type == 'error' || type == 'warning' ? 2 : 1)); - - if (type == 'loading' && !msg) - msg = this.get_label('loading'); + timeout = this.message_time * (type == 'error' || type == 'warning' ? 2 : 1); + + if (type == 'loading') { + key = 'loading'; + timeout = this.env.request_timeout * 1000; + if (!msg) + msg = this.get_label('loading'); + } // The same message is already displayed - if (this.messages[msg]) { - this.messages[msg].elements.push(id); + if (this.messages[key]) { + if (this.messages[key].obj) + this.messages[key].obj.html(msg); + this.messages[key].elements.push(id); window.setTimeout(function() { ref.hide_message(id, true); }, timeout); return id; } @@ -4540,14 +4547,14 @@ function rcube_webmail() if (type == 'loading') { obj.appendTo(cont); - this.messages[msg] = {'obj': obj, 'elements': [id]}; + this.messages[key] = {'obj': obj, 'elements': [id]}; window.setTimeout(function() { rcmail.hide_message(id); }, timeout); return id; } else { obj.appendTo(cont).bind('mousedown', function() { return ref.hide_message(obj, true); }); window.setTimeout(function() { ref.hide_message(id, true); }, timeout); - this.messages[msg] = { 'obj': obj, 'elements': [id] }; + this.messages[key] = { 'obj': obj, 'elements': [id] }; return id; } }; |