From 2cf8db4018661e9f0f9d9b24811487ea9960da10 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 2 Jun 2014 10:48:52 -0400 Subject: [PATCH] refactor(edit) showMessage --- lib/client/edit.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index b42801a7..2cf497f9 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -465,7 +465,9 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI var parent, HIDE_TIME = 2000; - if (!Msg) { + if (Msg) { + Msg.innerHTML = text; + } else { DOM.load.style({ id : 'msg-css', inner : '#js-view .msg {' + @@ -485,13 +487,16 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI Msg = DOM.load({ name : 'div', className : 'msg', - parent : parent + parent : parent, + inner : text }); } - Msg.innerHTML = text; DOM.show(Msg); - setTimeout(Util.exec.ret(DOM.hide, Msg), HIDE_TIME); + + setTimeout(function() { + DOM.hide(Msg); + }, HIDE_TIME); }; init();