diff --git a/lib/client/edit.js b/lib/client/edit.js index 6822b48c..1716b3b7 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -472,9 +472,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI this.showMessage = function(text) { var HIDE_TIME = 2000; - if (Msg) { - Msg.innerHTML = text; - } else { + if (!Msg) { DOM.load.style({ id : 'msg-css', inner : '#js-view .msg {' + @@ -490,19 +488,17 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI 'font-size' + ': 16px' + '}' }); - - Msg = DOM.load({ - name : 'div', - className : 'msg', - parent : Element, - inner : text - }); } - DOM.show(Msg); + Msg = DOM.load({ + name : 'div', + className : 'msg', + parent : Element, + inner : text + }); setTimeout(function() { - DOM.hide(Msg); + DOM.remove(Msg, Element); }, HIDE_TIME); };