From 29147257fb502bcc9167f847494fe557b803d3ca Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 10 Jun 2014 15:04:23 -0400 Subject: [PATCH] fix(edit) showMessage: empty message --- lib/client/edit.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) 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); };