diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index a974a3aa2..d38183d32 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -93,6 +93,16 @@ return result; }; + $(function () { + var populate = BI.Loader.prototype.populate; + BI.Loader.prototype.populate = function () { + pushContext(this); + var result = populate.apply(this, arguments); + popContext(); + return result; + }; + }); + var _init = BI.Widget.prototype._init; BI.Widget.prototype._init = function () { var self = this; diff --git a/src/core/base.js b/src/core/base.js index ca4a970d6..e2b1b6771 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -78,10 +78,16 @@ if (!window.BI) { return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View); }, - createWidgets: function (items, options) { + createWidgets: function (items, options, context) { if (!BI.isArray(items)) { throw new Error("cannot create Widgets"); } + if (BI.isWidget(options)) { + context = options; + options = {}; + } else { + options || (options = {}); + } return BI.map(BI.flatten(items), function (i, item) { return BI.createWidget(item, BI.deepClone(options)); });