From dbf6e0a81d43798b3a85df31959fa6da12b2b5d0 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 21 Mar 2019 14:10:34 +0000 Subject: [PATCH] Improve display_message() for sophisticated 'loading' messages So it's possible to display more than one message of type 'loading' at a time and define custom timeout. --- program/js/app.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 0fe8919be..aaa07fc0c 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -7906,6 +7906,14 @@ function rcube_webmail() if (!type) type = 'notice'; + else if (type == 'loading') { + if (!key) + key = 'loading'; + if (!timeout) + timeout = this.env.request_timeout * 1000; + if (!msg) + msg = this.get_label('loading'); + } if (!key) key = this.html_identifier(msg); @@ -7929,13 +7937,6 @@ function rcube_webmail() } } - 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[key]) { // replace label