diff --git a/dist/fix/fix.compact.ie.js b/dist/fix/fix.compact.ie.js index 29450ec7a..5f1444316 100644 --- a/dist/fix/fix.compact.ie.js +++ b/dist/fix/fix.compact.ie.js @@ -82,7 +82,7 @@ if (p instanceof Fix.Model || p.store || p.__cacheStore) { break; } - p = p._parent || (p.options && p.options.element); + p = p._context || p._parent || (p.options && p.options.element); } if (p) { if (p instanceof Fix.Model) { @@ -93,21 +93,6 @@ } } - // var _create = BI.createWidget; - // BI.createWidget = function (item, options, context) { - // var pushed = false; - // if (BI.isWidget(options)) { - // pushContext(options); - // pushed = true; - // } else if (context != null) { - // pushContext(context); - // pushed = true; - // } - // var result = _create.apply(this, arguments); - // pushed && popContext(); - // return result; - // }; - _.each(["populate", "addItems", "prependItems"], function (name) { var old = BI.Loader.prototype[name]; BI.Loader.prototype[name] = function () { @@ -121,7 +106,7 @@ function createStore () { var needPop = false; if (_global.Fix && this._store) { - var store = findStore(this.options.context || this._parent || this.options.element); + var store = findStore(this.options.context || this._context || this._parent || this.options.element); if (store) { pushTarget(store); needPop = true; diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 773ee7e47..44d4256b5 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -86,7 +86,7 @@ if (p instanceof Fix.Model || p.store || p.__cacheStore) { break; } - p = p._parent || (p.options && p.options.element); + p = p._context || p._parent || (p.options && p.options.element); } if (p) { if (p instanceof Fix.Model) { @@ -97,26 +97,6 @@ } } - // var _create = BI.createWidget; - // BI.createWidget = function (item, options, context) { - // var pushed = false; - // if (BI.isWidget(options)) { - // pushContext(options); - // pushed = true; - // } else if (context != null) { - // pushContext(context); - // pushed = true; - // } - // var result = _create.apply(this, arguments); - // // try { - // // var result = _create.apply(this, arguments); - // // } catch (e) { - // // console.error(e); - // // } - // pushed && popContext(); - // return result; - // }; - _.each(["populate", "addItems", "prependItems"], function (name) { var old = BI.Loader.prototype[name]; BI.Loader.prototype[name] = function () { @@ -134,7 +114,7 @@ function createStore () { var needPop = false; if (_global.Fix && this._store) { - var store = findStore(this.options.context || this._parent || this.options.element); + var store = findStore(this.options.context || this._context || this._parent || this.options.element); if (store) { pushTarget(store); needPop = true; diff --git a/examples/dev.html b/examples/dev.html index 6b6eb4f0c..03d77a1de 100644 --- a/examples/dev.html +++ b/examples/dev.html @@ -73,7 +73,7 @@ store.toggle(); }, 1000); BI.watch("text", function () { - child.populate(); + child.reset(); }); return function () { return { diff --git a/examples/tab-context.html b/examples/tab-context.html new file mode 100644 index 000000000..33edfd13c --- /dev/null +++ b/examples/tab-context.html @@ -0,0 +1,118 @@ + +
+ +