Browse Source

Pull request #2854: 无JIRA 给BI.config增加一个可以立即执行配置函数的功能

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '32d23f787f43113514ccecd65e084d605abfa2f7':
  无JIRA 给BI.config增加一个可以立即执行配置函数的功能
es6
Dailer 2 years ago
parent
commit
93be0bb7c2
  1. 21
      src/core/5.inject.js

21
src/core/5.inject.js

@ -92,12 +92,23 @@
};
var configFunctions = BI.OB.configFunctions = {};
var runConfigFunction = function (type) {
var runConfigFunction = function (type, configFn) {
if (!type || !configFunctions[type]) {
return false;
}
var queue = configFunctions[type];
delete configFunctions[type];
var queue = [];
if (configFn) {
queue = configFunctions[type].filter(function (conf) {
return conf.fn === configFn;
});
configFunctions[type] = configFunctions[type].filter(function (conf) {
return conf.fn !== configFn;
});
} else {
queue = configFunctions[type];
delete configFunctions[type];
}
var dependencies = BI.Providers.getProvider("bi.provider.system").getDependencies();
var modules = moduleInjectionMap.components[type]
@ -176,6 +187,10 @@
fn: configFn,
opt: opt
});
if (opt.immediately) {
return runConfigFunction(type, configFn);
}
};
BI.getReference = BI.getReference || function (type, fn) {

Loading…
Cancel
Save