2015-09-07 21:53:43 +00:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2015-01-16 02:17:54 +00:00
|
|
|
*/
|
|
|
|
(function () {
|
|
|
|
'use strict';
|
2015-03-05 23:44:53 +00:00
|
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
|
2015-03-05 23:25:49 +00:00
|
|
|
Whisper.ToastView = Whisper.View.extend({
|
2015-03-03 00:31:04 +00:00
|
|
|
className: 'toast',
|
2015-01-16 02:17:54 +00:00
|
|
|
initialize: function() {
|
2015-01-24 20:23:21 +00:00
|
|
|
this.$el.hide();
|
2015-01-16 02:17:54 +00:00
|
|
|
},
|
|
|
|
|
2015-03-03 00:31:04 +00:00
|
|
|
close: function() {
|
|
|
|
this.$el.fadeOut(this.remove.bind(this));
|
2015-01-16 02:17:54 +00:00
|
|
|
},
|
|
|
|
|
2015-03-03 00:31:04 +00:00
|
|
|
render: function() {
|
2015-12-26 04:38:16 +00:00
|
|
|
this.$el.html(Mustache.render(
|
|
|
|
_.result(this, 'template', ''),
|
|
|
|
_.result(this, 'render_attributes', '')
|
|
|
|
));
|
2015-05-25 17:43:35 +00:00
|
|
|
this.$el.show();
|
2015-03-03 00:31:04 +00:00
|
|
|
setTimeout(this.close.bind(this), 2000);
|
2015-01-16 02:17:54 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|