From 3483196b3b6e84f5c476ea2901fc3918f6211736 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 24 Feb 2015 04:00:31 -0500 Subject: [PATCH] fix(edit) show: set mode before data set --- lib/client/edit.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index d6591fe2..550e5bce 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -63,26 +63,27 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format, edward; } this.show = function(callback) { - var isDir = Info.isDir, - name = Info.name, - path = Info.path; - Images.show.load(); setMsgChanged(name); if (callback) ConfigView.beforeShow = callback; - if (isDir) - edward.setMode('json'); - else - edward.setModeForPath(name); - Info.getData(function(error, data) { + var isDir = Info.isDir, + name = Info.name, + path = Info.path; + if (error) { alert(error); } else { edward.setValueFirst(path, data); + + if (isDir) + edward.setMode('json'); + else + edward.setModeForPath(name); + CloudCmd.View.show(Element, ConfigView); } });