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