diff --git a/lib/client/edit.js b/lib/client/edit.js index da11efaf..d04ce9db 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -429,6 +429,21 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI Util.timeEnd(Name + ' load'); Util.exec(callback); }); + + DOM.load.style({ + id : 'msg-css', + inner : '#js-view .msg {' + + 'z-index' + ': 1;' + + 'background-color' + ': #7285B7;' + + 'color' + ': #D1F1A9;' + + 'position' + ': fixed;' + + 'left' + ': 40%;' + + 'top' + ': 25px;' + + 'padding' + ': 5px;' + + 'opacity' + ': 0.9;' + + 'transition' + ': ease 0.5s;' + + '}' + }); }); } @@ -470,24 +485,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI } this.showMessage = function(text) { - var HIDE_TIME = 2000; - - if (!Msg) { - DOM.load.style({ - id : 'msg-css', - inner : '#js-view .msg {' + - 'z-index' + ': 1;' + - 'background-color' + ': #7285B7;' + - 'color' + ': #D1F1A9;' + - 'position' + ': fixed;' + - 'left' + ': 40%;' + - 'top' + ': 25px;' + - 'padding' + ': 5px;' + - 'opacity' + ': 0.9;' + - 'transition' + ': ease 0.5s;' + - '}' - }); - } + var msg, HIDE_TIME = 2000; /* * Msg should be created and removed @@ -496,15 +494,16 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI * is called - bug occures: empty box * with no text inside. */ - Msg = DOM.load({ + msg = DOM.load({ name : 'div', className : 'msg', parent : Element, - inner : text + inner : text, + func : alert }); setTimeout(function() { - DOM.remove(Msg, Element); + DOM.remove(msg, Element); }, HIDE_TIME); };