X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/6a38c4ea4b6853116bf2302cd73d6c51f696888a..36387dac2e103ca656be9dc65fabb936f80191d1:/project/static/js/messages.js diff --git a/project/static/js/messages.js b/project/static/js/messages.js index c64aa5bd..51a457dd 100644 --- a/project/static/js/messages.js +++ b/project/static/js/messages.js @@ -7,13 +7,14 @@ Editor.MessageCenter = Editor.Object.extend({ }, addMessage: function(type, text, flash) { + if (!flash) { + flash = text; + } this.messages.push({type: type, text: text}); - if (flash) { - 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); - } + 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); } }, @@ -21,7 +22,7 @@ Editor.MessageCenter = Editor.Object.extend({ this.flashMessages.splice(0, 1); if (this.flashMessages.length > 0) { this.set('firstFlashMessage', this.flashMessages[0]); - setTimeout(this.changeFlashMessage.bind(this), 1000 * 10); + setTimeout(this.changeFlashMessage.bind(this), 1000 * 3); // 3 seconds } else { this.set('firstFlashMessage', null); }