mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
refactor(client) initModules
This commit is contained in:
parent
8a99584115
commit
ef10353b7d
1 changed files with 6 additions and 11 deletions
|
|
@ -206,7 +206,7 @@ var Util, DOM, CloudFunc;
|
|||
});
|
||||
|
||||
CloudCmd.getModules(function(modules) {
|
||||
var i, n, module, storageObj, mod, name, path,
|
||||
var storageObj, mod, path,
|
||||
STORAGE = 'storage',
|
||||
showLoad = Images.showLoad.bind(Images),
|
||||
|
||||
|
|
@ -227,29 +227,24 @@ var Util, DOM, CloudFunc;
|
|||
if (!modules)
|
||||
modules = [];
|
||||
|
||||
n = modules.length;
|
||||
for (i = 0; i < n ; i++) {
|
||||
module = modules[i];
|
||||
|
||||
modules.forEach(function(module) {
|
||||
if (Util.isString(module))
|
||||
load(null, module, doBefore[module]);
|
||||
}
|
||||
});
|
||||
|
||||
storageObj = Util.findObjByNameInArr(modules, STORAGE),
|
||||
mod = Util.getNamesFromObjArray(storageObj);
|
||||
|
||||
for (i = 0, n = mod.length; i < n; i++) {
|
||||
name = mod[i],
|
||||
|
||||
mod.forEach(function(name) {
|
||||
path = STORAGE + '/_' + name.toLowerCase();
|
||||
|
||||
load(name, path, doBefore[path]);
|
||||
}
|
||||
});
|
||||
|
||||
Util.exec(callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function baseInit(pCallBack) {
|
||||
var files = DOM.getFiles(),
|
||||
LEFT = CloudFunc.PANEL_LEFT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue