|
|
@ -5,6 +5,13 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
* @cfg {JSON} options 配置属性 |
|
|
|
* @cfg {JSON} options 配置属性 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!(function () { |
|
|
|
|
|
|
|
var lazy = (typeof document !== 'undefined' && |
|
|
|
|
|
|
|
typeof document.documentMode === 'number') || |
|
|
|
|
|
|
|
(typeof navigator !== 'undefined' && |
|
|
|
|
|
|
|
typeof navigator.userAgent === 'string' && |
|
|
|
|
|
|
|
/\bEdge\/\d/.test(navigator.userAgent)); |
|
|
|
BI.Widget = BI.inherit(BI.OB, { |
|
|
|
BI.Widget = BI.inherit(BI.OB, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), { |
|
|
|
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), { |
|
|
@ -52,6 +59,7 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
this._initElementHeight(); |
|
|
|
this._initElementHeight(); |
|
|
|
this._initVisual(); |
|
|
|
this._initVisual(); |
|
|
|
this._initState(); |
|
|
|
this._initState(); |
|
|
|
|
|
|
|
if (this.isVisible()) { |
|
|
|
if (this.beforeInit) { |
|
|
|
if (this.beforeInit) { |
|
|
|
this.__asking = true; |
|
|
|
this.__asking = true; |
|
|
|
this.beforeInit(BI.bind(this._render, this)); |
|
|
|
this.beforeInit(BI.bind(this._render, this)); |
|
|
@ -61,6 +69,11 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this._render(); |
|
|
|
this._render(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.rendered = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this._isRoot) { |
|
|
|
|
|
|
|
this._mount() |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_render: function () { |
|
|
|
_render: function () { |
|
|
@ -172,7 +185,7 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
_mount: function () { |
|
|
|
_mount: function () { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
var isMounted = this._isMounted; |
|
|
|
var isMounted = this._isMounted; |
|
|
|
if (isMounted || !this.isVisible() || this.__asking === true) { |
|
|
|
if (this._isMounting || isMounted || !this.isVisible() || this.__asking === true) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (this._isRoot === true) { |
|
|
|
if (this._isRoot === true) { |
|
|
@ -183,15 +196,30 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
if (!isMounted) { |
|
|
|
if (!isMounted) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this._isMounting = true |
|
|
|
|
|
|
|
if (!this.rendered) { |
|
|
|
|
|
|
|
if (this.beforeInit) { |
|
|
|
|
|
|
|
this.__asking = true; |
|
|
|
|
|
|
|
this.beforeInit(BI.bind(this._render, this)); |
|
|
|
|
|
|
|
if (this.__asking === true) { |
|
|
|
|
|
|
|
this.__async = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this._render(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.beforeMount && this.beforeMount(); |
|
|
|
this.beforeMount && this.beforeMount(); |
|
|
|
this._isMounted = true; |
|
|
|
this._isMounted = true; |
|
|
|
this._mountChildren && this._mountChildren(); |
|
|
|
lazy && 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(); |
|
|
|
widget._mount && widget._mount(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
!lazy && this._mountChildren && this._mountChildren(); |
|
|
|
this.mounted && this.mounted(); |
|
|
|
this.mounted && this.mounted(); |
|
|
|
|
|
|
|
this._isMounting = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_mountChildren: null, |
|
|
|
_mountChildren: null, |
|
|
@ -468,3 +496,4 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
this.purgeListeners(); |
|
|
|
this.purgeListeners(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
})(); |