X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/7f3f79476a57d10991566c511d40e20154c01064..78644811ca0c6042212788dc67add42bc41fb74c:/project/static/js/messages.js?ds=inline diff --git a/project/static/js/messages.js b/project/static/js/messages.js deleted file mode 100644 index 51a457dd..00000000 --- a/project/static/js/messages.js +++ /dev/null @@ -1,35 +0,0 @@ -/*global Editor*/ -Editor.MessageCenter = Editor.Object.extend({ - init: function() { - this.messages = []; - this.flashMessages = []; - this.firstFlashMessage = null; - }, - - addMessage: function(type, text, flash) { - if (!flash) { - flash = text; - } - this.messages.push({type: type, text: text}); - this.flashMessages.push({type: type, text: flash}); - if (this.flashMessages.length == 1) { - this.set('firstFlashMessage', this.flashMessages[0]); - setTimeout(this.changeFlashMessage.bind(this), 1000 * 10); - } - }, - - changeFlashMessage: function() { - this.flashMessages.splice(0, 1); - if (this.flashMessages.length > 0) { - this.set('firstFlashMessage', this.flashMessages[0]); - setTimeout(this.changeFlashMessage.bind(this), 1000 * 3); // 3 seconds - } else { - this.set('firstFlashMessage', null); - } - } - -}); - - -var messageCenter = new Editor.MessageCenter(); -