summaryrefslogtreecommitdiff
path: root/web-ui/app/js/user_alerts/ui
diff options
context:
space:
mode:
authorFelix Hammerl <fhammerl@thoughtworks.com>2016-03-07 17:59:51 +0100
committerFelix Hammerl <fhammerl@thoughtworks.com>2016-03-09 16:11:38 +0100
commitd4822d8923c6e4535ee09eafb035f1b15742c637 (patch)
treea83d7b1c0032f2ce8377e19afc226fffc54b9259 /web-ui/app/js/user_alerts/ui
parent3994188a0e4d9468518132f179eb56fab7760fbe (diff)
Issue #620: Spike growl CSS modularization
Diffstat (limited to 'web-ui/app/js/user_alerts/ui')
-rw-r--r--web-ui/app/js/user_alerts/ui/user_alerts.js14
1 files changed, 10 insertions, 4 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 b02762aa..e944a7a5 100644
--- a/web-ui/app/js/user_alerts/ui/user_alerts.js
+++ b/web-ui/app/js/user_alerts/ui/user_alerts.js
@@ -32,20 +32,26 @@ define(
dismissTimeout: 3000
});
- this.render = function (message) {
+ this.render = function(message) {
this.$node.html(templates.userAlerts.message(message));
this.show();
setTimeout(this.hide.bind(this), this.attr.dismissTimeout);
};
- this.displayMessage = function (ev, data) {
- this.render({ message: {content: data.message, class: (data.class || 'success')}});
+ this.displayMessage = function(ev, data) {
+ this.render({
+ message: {
+ content: data.message,
+ class: 'message-panel__growl--' + (data.class || 'success')
+ }
+ });
};
- this.after('initialize', function () {
+ this.after('initialize', function() {
this.on(document, events.ui.userAlerts.displayMessage, this.displayMessage);
});
}
}
);
+