From 1dba232a9e1078b75a223c17c4af2241e7f10bab Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 15 Jun 2021 11:23:03 +0800 Subject: [PATCH 1/2] bugfix --- src/core/4.widget.js | 16 ++++++++++------ src/core/wrapper/layout.js | 5 ----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index b34dbbd0e..8eb0d6a53 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -553,6 +553,14 @@ this.purgeListeners(); }, + _empty: function () { + BI.each(this._children, function (i, widget) { + widget && widget._unMount && widget._unMount(); + }); + this._children = {}; + this.element.empty(); + }, + isolate: function () { if (this._parent) { this._parent.removeWidget(this); @@ -561,11 +569,7 @@ }, empty: function () { - BI.each(this._children, function (i, widget) { - widget && widget._unMount && widget._unMount(); - }); - this._children = {}; - this.element.empty(); + this._empty(); }, // 默认的reset方法就是干掉重来 @@ -576,7 +580,7 @@ } // this._isMounted = false; // this.purgeListeners(); - this.empty(); + this._empty(); this.element.unbind(); this._initCurrent(); this._init(); diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 20f68850c..ad3fa2b90 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -581,11 +581,6 @@ BI.Layout = BI.inherit(BI.Widget, { } }, - empty: function () { - BI.Layout.superclass.empty.apply(this, arguments); - this.options.items = []; - }, - destroy: function () { BI.Layout.superclass.destroy.apply(this, arguments); this.options.items = []; From 9524ab155bce27d806058bf29ecd4ad77a1cf0d2 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 15 Jun 2021 11:24:32 +0800 Subject: [PATCH 2/2] bugfix --- src/core/wrapper/layout.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index ad3fa2b90..20f68850c 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -581,6 +581,11 @@ BI.Layout = BI.inherit(BI.Widget, { } }, + empty: function () { + BI.Layout.superclass.empty.apply(this, arguments); + this.options.items = []; + }, + destroy: function () { BI.Layout.superclass.destroy.apply(this, arguments); this.options.items = [];