diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2017-03-24 15:54:27 -0300 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2017-03-24 15:54:27 -0300 |
commit | 56fdf12fd1d7f583e4a07e84b1af4595182c0d15 (patch) | |
tree | 3ca77b7bf90838822966aa1e95b2227544b8253a /web-ui/app/js/user_alerts/ui | |
parent | 001efcb7434328d339e50fcfc5193ddb5eb31bd6 (diff) |
[#830] Improve timeout of user alerts
with @anikarni
Diffstat (limited to 'web-ui/app/js/user_alerts/ui')
-rw-r--r-- | web-ui/app/js/user_alerts/ui/user_alerts.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/web-ui/app/js/user_alerts/ui/user_alerts.js b/web-ui/app/js/user_alerts/ui/user_alerts.js index e944a7a5..bef3efcd 100644 --- a/web-ui/app/js/user_alerts/ui/user_alerts.js +++ b/web-ui/app/js/user_alerts/ui/user_alerts.js @@ -29,21 +29,22 @@ define( function userAlerts() { this.defaultAttrs({ - dismissTimeout: 3000 + dismissTimeout: 4000 }); this.render = function(message) { + clearTimeout(this.attr.timeout); this.$node.html(templates.userAlerts.message(message)); this.show(); - setTimeout(this.hide.bind(this), this.attr.dismissTimeout); + this.attr.timeout = setTimeout(this.hide.bind(this), message.dismissTimeout || this.attr.dismissTimeout); }; - this.displayMessage = function(ev, data) { this.render({ message: { content: data.message, - class: 'message-panel__growl--' + (data.class || 'success') + class: 'message-panel__growl--' + (data.class || 'success'), + dismissTimeout: data.dismissTimeout } }); }; @@ -54,4 +55,3 @@ define( } } ); - |