Browse Source

Merge pull request #162599 in DEC/fineui from master to feature/x

* commit '318d76583dbfe08634ffdcbe764012ce5efd8926':
  feature: 内存溢出换一种实现方案
master
superman 2 years ago
parent
commit
ceda8a1edb
  1. 14
      src/core/4.widget.js

14
src/core/4.widget.js

@ -392,7 +392,7 @@
*/ */
_mount: function (force, deep, lifeHook, predicate, layer) { _mount: function (force, deep, lifeHook, predicate, layer) {
var self = this; var self = this;
if (!force && (this._isMounted || 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;
} }
layer = layer || 0; layer = layer || 0;
@ -748,7 +748,16 @@
this.purgeListeners(); this.purgeListeners();
}, },
_assetMounted: function () {
if (!this.isVisible()) {
this._setVisible(true);
this._mount(false, false, false);
this._setVisible(false);
}
},
_empty: function () { _empty: function () {
this._assetMounted();
BI.each(this._children, function (i, widget) { BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount(); widget && widget._unMount && widget._unMount();
}); });
@ -790,6 +799,7 @@
}); });
}); });
this._watchers && (this._watchers = []); this._watchers && (this._watchers = []);
this._assetMounted();
this.__d(); this.__d();
this.element.empty(); this.element.empty();
this.element.unbind(); this.element.unbind();
@ -799,6 +809,7 @@
}, },
_destroy: function () { _destroy: function () {
this._assetMounted();
this.__destroy(); this.__destroy();
this.element.destroy(); this.element.destroy();
this.purgeListeners(); this.purgeListeners();
@ -806,6 +817,7 @@
destroy: function () { destroy: function () {
var self = this, o = this.options; var self = this, o = this.options;
this._assetMounted();
this.__destroy(); this.__destroy();
if (o.animation) { if (o.animation) {
this._innerSetVisible(false); this._innerSetVisible(false);

Loading…
Cancel
Save