|
|
@ -226,31 +226,21 @@ |
|
|
|
* @returns {boolean} |
|
|
|
* @returns {boolean} |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_mount: function (force, deep, lifeHook, predicate, layer, queue) { |
|
|
|
_mount: function (force, deep, lifeHook, predicate) { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
if (!layer) { |
|
|
|
|
|
|
|
layer = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!queue) { |
|
|
|
|
|
|
|
queue = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) { |
|
|
|
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
lifeHook !== false && callLifeHook(this, "beforeMount"); |
|
|
|
lifeHook !== false && callLifeHook(this, "beforeMount"); |
|
|
|
this._isMounted = true; |
|
|
|
this._isMounted = true; |
|
|
|
queue.push(this); |
|
|
|
// this._mountChildren && this._mountChildren();
|
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
!self.isEnabled() && widget._setEnable(false); |
|
|
|
!self.isEnabled() && widget._setEnable(false); |
|
|
|
!self.isValid() && widget._setValid(false); |
|
|
|
!self.isValid() && widget._setValid(false); |
|
|
|
widget._mount && widget._mount(deep ? force : false, deep, lifeHook, predicate, layer + 1, queue); |
|
|
|
widget._mount && widget._mount(deep ? force : false, deep, lifeHook, predicate); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this._mountChildren && this._mountChildren(); |
|
|
|
this._mountChildren && this._mountChildren(); |
|
|
|
if (layer === 0) { |
|
|
|
this.__afterMount(lifeHook, predicate); |
|
|
|
BI.each(queue, function (i, w) { |
|
|
|
|
|
|
|
w.__afterMount(lifeHook, predicate); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|