X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/af0452ad29bec28c7095f144e11337e0972b7670..514e98aeae05045d0086aae39960124a572e646f:/platforma/static/js/views/flash.js diff --git a/platforma/static/js/views/flash.js b/platforma/static/js/views/flash.js deleted file mode 100644 index e67b0463..00000000 --- a/platforma/static/js/views/flash.js +++ /dev/null @@ -1,42 +0,0 @@ -/*globals View render_template*/ -var FlashView = View.extend({ - template: 'flash-view-template', - - init: function(element, model, template) { - this.shownMessage = null; - this._super(element, model, template); - this.setModel(model); - }, - - setModel: function(model) { - if (this.model) { - this.model.removeObserver(this); - } - this.model = model; - this.shownMessage = null; - if (this.model) { - this.shownMessage = this.model.get('firstFlashMessage'); - this.model.addObserver(this, 'firstFlashMessage', this.modelFirstFlashMessageChanged.bind(this)); - } - this.render(); - }, - - render: function() { - this.element.html(render_template(this.template, this)); - setTimeout(function() {}, 0); - }, - - modelFirstFlashMessageChanged: function(property, value) { - this.element.fadeOut(200, (function() { - - this.element.css({'z-index': 0}); - this.shownMessage = value; - this.render(); - - if(this.shownMessage) { - this.element.css({'z-index': 1000}); - this.element.fadeIn(); - }; - }).bind(this)); - } -});