|
|
|
@ -903,14 +903,24 @@
|
|
|
|
|
|
|
|
|
|
BI.useContext = function (inject) { |
|
|
|
|
if (BI.Model.target) { |
|
|
|
|
var p = BI.Model.target; |
|
|
|
|
var vm = BI.Model.target; |
|
|
|
|
if (inject) { |
|
|
|
|
while (p) { |
|
|
|
|
if (p.$$context && inject in p.$$context) { |
|
|
|
|
return p; |
|
|
|
|
if (vm.$$computed && inject in vm.$$computed) { |
|
|
|
|
return vm; |
|
|
|
|
} |
|
|
|
|
p = p._parent; |
|
|
|
|
if (vm.$$state && inject in vm.$$state) { |
|
|
|
|
return vm; |
|
|
|
|
} |
|
|
|
|
if (vm.$$model && inject in vm.$$model) { |
|
|
|
|
return vm; |
|
|
|
|
} |
|
|
|
|
while (vm) { |
|
|
|
|
if (vm.$$context && inject in vm.$$context) { |
|
|
|
|
return vm; |
|
|
|
|
} |
|
|
|
|
vm = vm._parent; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return BI.Model.target; |
|
|
|
|