diff --git a/dist/fix/fix.compact.ie.js b/dist/fix/fix.compact.ie.js index a2eb1937d..7710468dc 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 a023efb99..433d107b7 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 e14646c67..001a73b8c 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 d98ec6398..f309497a2 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); });