修复移动端销毁错误bug

This commit is contained in:
Harvey Zack committed 2018-11-28 20:03:47 +08:00
1 parent a63cc35df0
commit 0e716da80d
3 files changed
+13 -8

No files matched your search

+5 -4
View File
@@ -108,11 +108,10 @@ class Artplayer extends Emitter {
}
init() {
this.isFocus = false;
this.whitelist = new Whitelist(this);
this.template = new Template(this);
if (this.whitelist.state) {
this.isFocus = false;
this.storage = new Storage(this);
this.i18n = new I18n(this);
this.notice = new Notice(this);
@@ -139,9 +138,11 @@ class Artplayer extends Emitter {
}
destroy(removeHtml = false) {
Artplayer.instances.splice(Artplayer.instances.indexOf(this), 1);
this.events.destroy();
if (this.events) {
this.events.destroy();
}
this.template.destroy(removeHtml);
Artplayer.instances.splice(Artplayer.instances.indexOf(this), 1);
this.emit('destroy');
}
}