diff --git a/src/core/4.widget.js b/src/core/4.widget.js index f8fe45929..4a1212962 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -768,7 +768,18 @@ } }; - BI.useContext = function () { + BI.useContext = function (inject) { + if (BI.Model.target) { + var p = BI.Model.target; + if (inject) { + while (p) { + if (p.$$context && inject in p.$$context) { + return p; + } + p = p._parent; + } + } + } return BI.Model.target; };