Browse Source

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

* commit '45480068009c7beb74d53dc6389d526d32a1b92e':
  KERNEL-11580 fix: 内存泄漏问题
es6
superman 2 years ago
parent
commit
b7f44dab1a
  1. 4
      src/base/combination/bubble.js
  2. 4
      src/base/combination/combo.js
  3. 4
      src/base/combination/expander.js
  4. 4
      src/base/combination/switcher.js
  5. 4
      src/base/single/button/button.basic.js
  6. 6
      src/core/4.widget.js

4
src/base/combination/bubble.js

@ -44,7 +44,9 @@
var self = this, o = this.options;
this._initCombo();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/combination/combo.js

@ -50,7 +50,9 @@
var self = this, o = this.options;
this._initCombo();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/combination/expander.js

@ -26,7 +26,9 @@ BI.Expander = BI.inherit(BI.Widget, {
this._expanded = !!o.el.open;
this._initExpander();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/combination/switcher.js

@ -26,7 +26,9 @@ BI.Switcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this._initSwitcher();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/single/button/button.basic.js

@ -49,7 +49,9 @@ BI.BasicButton = BI.inherit(BI.Single, {
this.setSelected(true);
}
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this.bindEvent.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this.bindEvent();
});
BI.BasicButton.superclass._initRef.apply(this, arguments);
},

6
src/core/4.widget.js

@ -346,6 +346,7 @@
_initState: function () {
this._isMounted = false;
this._isDestroyed = false;
},
__initWatch: function () {
@ -449,6 +450,10 @@
return this._isMounted;
},
isDestroyed: function () {
return this._isDestroyed;
},
setWidth: function (w) {
this.options.width = w;
this._initElementWidth();
@ -732,6 +737,7 @@
this._isMounted = false;
callLifeHook(this, "destroyed");
this.destroyed = null;
this._isDestroyed = true;
},
_unMount: function () {

Loading…
Cancel
Save