Browse Source

chore: 整理代码

es6
guy 3 years ago
parent
commit
6aa3895895
  1. 15
      src/core/4.widget.js

15
src/core/4.widget.js

@ -16,6 +16,7 @@
_global.clearTimeout;
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function callLifeHook (self, life) {
var hooks = [], hook;
hook = self[life];
@ -477,7 +478,7 @@
}
},
setVisible: function (visible) {
_innerSetVisible: function (visible) {
var self = this, o = this.options;
var lastVisible = !o.invisible;
this._setVisible(visible);
@ -522,6 +523,10 @@
this.element.css("display", "none");
}
}
},
setVisible: function (visible) {
this._innerSetVisible(visible);
this.fireEvent(BI.Events.VIEW, visible);
},
@ -753,8 +758,16 @@
},
destroy: function () {
var self = this, o = this.options;
this.__d();
if (o.animation) {
this._innerSetVisible(false);
setTimeout(function () {
self.element.destroy();
}, o.animationDuring);
} else {
this.element.destroy();
}
this.fireEvent(BI.Events.UNMOUNT);
this.fireEvent(BI.Events.DESTROY);
this._purgeRef();

Loading…
Cancel
Save