From 817d54e5912968a5d5be751500885b6c43d22e3d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 27 Feb 2015 09:21:43 -0500 Subject: [PATCH] refactor(edit) show: rm once("change") --- lib/client/edit.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index 4afb6f7d..996d13ad 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -72,26 +72,22 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format, edward; ConfigView.beforeShow = callback; Info.getData(function(error, data) { - var path = Info.path; + var path = Info.path, + isDir = Info.isDir, + name = Info.name; + + if (isDir) + name += '.json'; if (error) { alert(error); } else { - edward.once('change', function() { - var isDir = Info.isDir, - name = Info.name; - - setMsgChanged(name); - - if (isDir) - name += '.json'; - - edward.setModeForPath(name); - - CloudCmd.View.show(Element, ConfigView); - }); - edward.setValueFirst(path, data); + + setMsgChanged(name); + edward.setModeForPath(name); + + CloudCmd.View.show(Element, ConfigView); } });