diff --git a/lib/client.js b/lib/client.js index 088f5b13..d2d8f283 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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,