signal-desktop/js/views/toast_view.js

28 lines
652 B
JavaScript
Raw Normal View History

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