mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
refactor(config) show: add asyncCall
This commit is contained in:
parent
7f78df069b
commit
2bee4d5f0e
1 changed files with 17 additions and 8 deletions
|
|
@ -27,21 +27,30 @@ var CloudCmd, Util, DOM;
|
|||
};
|
||||
|
||||
this.show = function() {
|
||||
var funcs = [
|
||||
getTemplate,
|
||||
cssLoad
|
||||
];
|
||||
|
||||
Images.showLoad({top:true});
|
||||
|
||||
DOM.cssLoad({
|
||||
src : '/css/config.css',
|
||||
func: getTemplate
|
||||
});
|
||||
Util.asyncCall(funcs, fillTemplate);
|
||||
};
|
||||
|
||||
function getTemplate() {
|
||||
Util.ifExec(TEMPLATE, fillTemplate, function (callback) {
|
||||
function cssLoad(callback) {
|
||||
DOM.cssLoad({
|
||||
src : '/css/config.css',
|
||||
func: Util.retExec(callback)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getTemplate(callback) {
|
||||
Util.ifExec(TEMPLATE, callback, function (execCall) {
|
||||
DOM.ajax({
|
||||
url : '/html/config.html',
|
||||
success : function(data) {
|
||||
TEMPLATE = data;
|
||||
callback();
|
||||
execCall();
|
||||
},
|
||||
error : Images.showError
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue