|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
p = p._parent; |
|
|
|
|
vm = vm._parent; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return BI.Model.target; |
|
|
|
|