|
|
@ -47,17 +47,42 @@ |
|
|
|
providerInjection[xtype] = cls; |
|
|
|
providerInjection[xtype] = cls; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var configFunctions = {}; |
|
|
|
BI.config = function (type, configFn) { |
|
|
|
BI.config = function (type, configFn) { |
|
|
|
if (constantInjection[type]) { |
|
|
|
if (BI.initialized) { |
|
|
|
return constantInjection[type] = configFn(constantInjection[type]); |
|
|
|
if (constantInjection[type]) { |
|
|
|
} |
|
|
|
return (constantInjection[type] = configFn(constantInjection[type])); |
|
|
|
if (providerInjection[type]) { |
|
|
|
|
|
|
|
if (!providers[type]) { |
|
|
|
|
|
|
|
providers[type] = new providerInjection[type](); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return configFn(providers[type]); |
|
|
|
if (providerInjection[type]) { |
|
|
|
|
|
|
|
if (!providers[type]) { |
|
|
|
|
|
|
|
providers[type] = new providerInjection[type](); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return configFn(providers[type]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.Plugin.configWidget(type, configFn); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!configFunctions[type]) { |
|
|
|
|
|
|
|
configFunctions[type] = []; |
|
|
|
|
|
|
|
BI.prepares.push(function () { |
|
|
|
|
|
|
|
var queue = configFunctions[type]; |
|
|
|
|
|
|
|
for (var i = 0; i < queue.length; i++) { |
|
|
|
|
|
|
|
if (constantInjection[type]) { |
|
|
|
|
|
|
|
constantInjection[type] = queue[i](constantInjection[type]); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (providerInjection[type]) { |
|
|
|
|
|
|
|
if (!providers[type]) { |
|
|
|
|
|
|
|
providers[type] = new providerInjection[type](); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
queue[i](providers[type]); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BI.Plugin.configWidget(type, queue[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
configFunctions[type] = null; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
BI.Plugin.configWidget(type, configFn); |
|
|
|
configFunctions[type].push(configFn); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var actions = {}; |
|
|
|
var actions = {}; |
|
|
@ -189,7 +214,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var providers = {}, providerInstance = {}; |
|
|
|
var providers = {}, |
|
|
|
|
|
|
|
providerInstance = {}; |
|
|
|
|
|
|
|
|
|
|
|
BI.Providers = { |
|
|
|
BI.Providers = { |
|
|
|
getProvider: function (type, config) { |
|
|
|
getProvider: function (type, config) { |
|
|
|