mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(edit) create
This commit is contained in:
parent
d65a39f722
commit
8913daa21b
1 changed files with 10 additions and 9 deletions
|
|
@ -50,7 +50,11 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, DiffProto, diff_match_patch, Zip, M
|
|||
callback();
|
||||
},
|
||||
function(callback) {
|
||||
Edit.show(callback);
|
||||
var element = createElement();
|
||||
|
||||
Edit.create(element)
|
||||
.show(callback);
|
||||
|
||||
}, callback]);
|
||||
}
|
||||
|
||||
|
|
@ -141,8 +145,7 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, DiffProto, diff_match_patch, Zip, M
|
|||
}
|
||||
|
||||
this.show = function(callback) {
|
||||
var element = Edit.create(),
|
||||
name = Info.name,
|
||||
var name = Info.name,
|
||||
isDir = Info.isDir;
|
||||
|
||||
Images.show.load();
|
||||
|
|
@ -160,7 +163,7 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, DiffProto, diff_match_patch, Zip, M
|
|||
alert(error);
|
||||
} else {
|
||||
Edit.setValue(data);
|
||||
CloudCmd.View.show(element, ConfigView);
|
||||
CloudCmd.View.show(Element, ConfigView);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -235,7 +238,7 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, DiffProto, diff_match_patch, Zip, M
|
|||
|
||||
if (!isEqual) {
|
||||
is = Dialog.confirm(msg);
|
||||
t
|
||||
|
||||
if (is)
|
||||
Edit.save();
|
||||
}
|
||||
|
|
@ -279,9 +282,7 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, DiffProto, diff_match_patch, Zip, M
|
|||
Session.setUseWorker(isMatch);
|
||||
}
|
||||
|
||||
this.create = function() {
|
||||
var element = createElement();
|
||||
|
||||
this.create = function(element) {
|
||||
Element = element;
|
||||
Ace = ace.edit(element);
|
||||
Session = Ace.getSession();
|
||||
|
|
@ -343,7 +344,7 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, DiffProto, diff_match_patch, Zip, M
|
|||
Ace.setOptions(options);
|
||||
});
|
||||
|
||||
return element;
|
||||
return this;
|
||||
};
|
||||
|
||||
Edit.save = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue