From 523bb11605e0c96f52260ace2eaa390389b04045 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 2 Oct 2014 04:13:47 -0400 Subject: [PATCH] feature(edit) show: rm value --- lib/client/edit.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index 461fe39d..f5f6c7c3 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -50,9 +50,8 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI ]); } - this.show = function(value) { + this.show = function() { var mode, htmlMode, jsMode, isHTML, isJS, modesByName, - isStr = type.string(value), name = Info.name, isDir = Info.isDir; @@ -96,22 +95,18 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI setUseOfWorker(mode); setEmmet(isHTML); - Util.exec.if(isStr, function() { + Info.getData(function(error, data) { var UndoManager = ace.require('ace/undomanager').UndoManager; + Value = data; + + if (isJS && Session.getUseWorker()) + setJsHintConfig(); + Ace.setValue(Value); CloudCmd.View.show(Element, ConfigView); Session.setUndoManager(new UndoManager()); - }, function(callback) { - Info.getData(function(error, data) { - Value = data; - - if (isJS && Session.getUseWorker()) - setJsHintConfig(); - - callback(); - }); }); } };