1 _kiwi
.view
.Notification
= Backbone
.View
.extend({
2 className
: 'notification',
5 'click .close': 'close'
8 initialize: function(title
, content
) {
10 this.content
= content
;
14 this.$el
.html($('#tmpl_notifications').html());
15 this.$('h6').text(this.title
);
17 // HTML string or jquery object
18 if (typeof this.content
=== 'string') {
19 this.$('.content').html(this.content
);
20 } else if (typeof this.content
=== 'object') {
21 this.$('.content').empty().append(this.content
);
30 this.render().$el
.appendTo(_kiwi
.app
.view
.$el
);
32 // The element won't have any CSS transitions applied
33 // until after a tick + paint.
35 that
.$el
.addClass('show');