diff --git a/dist/fix/fix.compact.ie.js b/dist/fix/fix.compact.ie.js index a2eb1937dc..7710468dca 100644 --- a/dist/fix/fix.compact.ie.js +++ b/dist/fix/fix.compact.ie.js @@ -122,7 +122,7 @@ function createStore () { var needPop = false; if (_global.Fix && this._store) { - var store = findStore(this.options.context || this._parent || this.options.element || this._context); + var store = findStore(this.options.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 a023efb99d..433d107b7b 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -135,7 +135,7 @@ function createStore () { var needPop = false; if (_global.Fix && this._store) { - var store = findStore(this.options.context || this._parent || this.options.element || this._context); + var store = findStore(this.options.context || this._parent || this.options.element); if (store) { pushTarget(store); needPop = true; diff --git a/src/core/shortcut.js b/src/core/shortcut.js index e14646c67d..001a73b8cc 100644 --- a/src/core/shortcut.js +++ b/src/core/shortcut.js @@ -17,16 +17,18 @@ if (!cls) { throw new Error("组件" + config.type + "未定义"); } - + var pushed = false; + if (context) { + pushed = true; + BI.Widget.pushContext(context); + } var widget = new cls(); - widget._context = context; - BI.Widget.pushContext(widget); widget._initProps(config); widget._initRoot(); - if (!lazy || config.element || config.root) { - widget._lazyConstructor(); - } - BI.Widget.popContext(); + // if (!lazy || config.element || config.root) { + widget._lazyConstructor(); + // } + pushed && BI.Widget.popContext(); return widget; }; diff --git a/src/core/widget.js b/src/core/widget.js index d98ec63984..f309497a25 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -338,9 +338,6 @@ throw new Error("name has already been existed"); } widget._setParent && widget._setParent(this); - BI.Widget.pushContext(widget); - widget._lazyConstructor(); - BI.Widget.popContext(); widget.on(BI.Events.DESTROY, function () { BI.remove(self._children, this); });