summaryrefslogtreecommitdiff
path: root/web-ui/app/js/user_alerts
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/app/js/user_alerts')
-rw-r--r--web-ui/app/js/user_alerts/ui/user_alerts.js10
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(
}
}
);
-