mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+25
-4
@@ -2,6 +2,7 @@
|
||||
* @class kit
|
||||
* @property {kit.bsCore}
|
||||
* @property {kit.toolkit}
|
||||
* @property {kit.Modal}
|
||||
*/
|
||||
window.kit = window.kit || {};
|
||||
(function(global){
|
||||
@@ -321,7 +322,7 @@ window.kit = window.kit || {};
|
||||
loadStyle(configModule.path + item);
|
||||
});
|
||||
|
||||
var depsPromise = this.__getDepsPromise(configModule.deps);
|
||||
var depsPromise = this.__getDepsPromise(this.depsCorrection(configModule.deps));
|
||||
setSkipLoadPromise(depsPromise);
|
||||
|
||||
if(depsPromise) {
|
||||
@@ -447,6 +448,21 @@ window.kit = window.kit || {};
|
||||
return module.exports;
|
||||
};
|
||||
|
||||
__proto.depsCorrection = function(deps){
|
||||
if(!Array.isArray(deps) ) {
|
||||
deps = [deps];
|
||||
}
|
||||
var correct = [];
|
||||
deps.forEach(function(pluginId, i, arr) {
|
||||
var realPlugin = this.__getPlugin(pluginId);
|
||||
if(realPlugin === undefined) {
|
||||
return false;
|
||||
}
|
||||
correct.push(realPlugin.id);
|
||||
}.bind(this));
|
||||
return correct;
|
||||
};
|
||||
|
||||
__proto.exec = function (deps, callback, argArr = [], context = undefined) {
|
||||
|
||||
if(typeof deps === 'function') {
|
||||
@@ -458,9 +474,8 @@ window.kit = window.kit || {};
|
||||
if(context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
if(!Array.isArray(deps) ) {
|
||||
deps = [deps];
|
||||
}
|
||||
|
||||
deps = this.depsCorrection(deps);
|
||||
|
||||
if(typeof argArr === 'undefined') {
|
||||
argArr = [];
|
||||
@@ -559,6 +574,12 @@ window.kit = window.kit || {};
|
||||
return this.plugins[_pluginId];
|
||||
}
|
||||
}
|
||||
|
||||
var _pluginId = pluginId[0].toUpperCase() + pluginId.slice(1);
|
||||
if(_pluginId !== pluginId) {
|
||||
return this.__getPlugin(_pluginId);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user