2018-04-27 21:25:04 +00:00
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
window.Whisper = window.Whisper || {};
|
2017-06-14 00:36:32 +00:00
|
|
|
|
2018-04-27 21:25:04 +00:00
|
|
|
Whisper.BannerView = Whisper.View.extend({
|
|
|
|
className: 'banner',
|
|
|
|
templateName: 'banner',
|
|
|
|
events: {
|
|
|
|
'click .dismiss': 'onDismiss',
|
|
|
|
'click .body': 'onClick',
|
|
|
|
},
|
|
|
|
initialize: function(options) {
|
|
|
|
this.message = options.message;
|
|
|
|
this.callbacks = {
|
|
|
|
onDismiss: options.onDismiss,
|
|
|
|
onClick: options.onClick,
|
|
|
|
};
|
|
|
|
this.render();
|
|
|
|
},
|
|
|
|
render_attributes: function() {
|
|
|
|
return {
|
|
|
|
message: this.message,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onDismiss: function(e) {
|
|
|
|
this.callbacks.onDismiss();
|
|
|
|
e.stopPropagation();
|
|
|
|
},
|
|
|
|
onClick: function() {
|
|
|
|
this.callbacks.onClick();
|
|
|
|
},
|
|
|
|
});
|
2017-06-14 00:36:32 +00:00
|
|
|
})();
|