refactor(edit) create

This commit is contained in:
coderaiser 2015-01-08 12:14:06 -05:00
parent d65a39f722
commit 8913daa21b

View file

@ -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() {