From 9da829723dbf508f37df5d3ec7effa4b5dd8991b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 26 Dec 2016 17:22:02 +0200 Subject: [PATCH] feature(edit) add setValue --- client/edit.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/client/edit.js b/client/edit.js index d9d494a7..e1aedfbf 100644 --- a/client/edit.js +++ b/client/edit.js @@ -94,18 +94,27 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format; if (error) return Images.hide(); - editor.setValueFirst(path, data); - - setMsgChanged(name); - - editor - .setModeForPath(name) - .setOption('fontSize', 16); + Edit.setValue(data, { + name: name, + path: path + }); CloudCmd.View.show(Element, ConfigView); }); }; + this.setValue = function(value, info) { + var path = info.path; + var name = info.name; + + editor + .setValueFirst(path, value) + .setModeForPath(name) + .setOption('fontSize', 16); + + setMsgChanged(name); + }; + this.hide = function() { CloudCmd.View.hide(); };