|
|
@ -49,7 +49,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
var configFunctions = {}; |
|
|
|
var configFunctions = {}; |
|
|
|
BI.config = function (type, configFn, options) { |
|
|
|
BI.config = function (type, configFn, options) { |
|
|
|
if (BI.initialize) { |
|
|
|
if (BI.initialized) { |
|
|
|
if (constantInjection[type]) { |
|
|
|
if (constantInjection[type]) { |
|
|
|
return (constantInjection[type] = configFn(constantInjection[type])); |
|
|
|
return (constantInjection[type] = configFn(constantInjection[type])); |
|
|
|
} |
|
|
|
} |
|
|
@ -64,16 +64,16 @@ |
|
|
|
if (!configFunctions[type]) { |
|
|
|
if (!configFunctions[type]) { |
|
|
|
configFunctions[type] = []; |
|
|
|
configFunctions[type] = []; |
|
|
|
BI.prepares.push(function () { |
|
|
|
BI.prepares.push(function () { |
|
|
|
var stack = [], head; |
|
|
|
var stack = [], head, count, index; |
|
|
|
for (var len = configFunctions[type].length, i = len - 1; i >= 0; i--) { |
|
|
|
for (count = configFunctions[type].length, index = count - 1; index >= 0; index--) { |
|
|
|
head = configFunctions[type][i]; |
|
|
|
head = configFunctions[type][index]; |
|
|
|
stack.push(i); |
|
|
|
stack.push(index); |
|
|
|
if (head.options && head.options.prevent) { |
|
|
|
if (head.options && head.options.prevent) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (var len = stack.length, i = len - 1; i >= 0; i--) { |
|
|
|
for (count = stack.length, index = count - 1; index >= 0; index--) { |
|
|
|
head = configFunctions[type][stack[i]]; |
|
|
|
head = configFunctions[type][stack[index]]; |
|
|
|
if (constantInjection[type]) { |
|
|
|
if (constantInjection[type]) { |
|
|
|
constantInjection[type] = head.fn(constantInjection[type]); |
|
|
|
constantInjection[type] = head.fn(constantInjection[type]); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|