mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 22:06:17 -08:00
update Component
This commit is contained in:
1 parent
3c8cb0e2e2
commit
90915652aa
5 files changed
+17
-27
No files matched your search
@@ -67,9 +67,12 @@ export default class Events {
|
||||
});
|
||||
}
|
||||
|
||||
remove(event) {
|
||||
const index = this.destroyEvents.indexOf(event);
|
||||
if (index > -1) this.destroyEvents.splice(index, 1);
|
||||
remove(destroyEvent) {
|
||||
const index = this.destroyEvents.indexOf(destroyEvent);
|
||||
if (index > -1) {
|
||||
destroyEvent();
|
||||
this.destroyEvents.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
@@ -91,16 +91,12 @@ export default class Setting extends Component {
|
||||
|
||||
remove() {
|
||||
for (let index = 0; index < this.events.length; index++) {
|
||||
const destroyEvent = this.events[index];
|
||||
this.art.events.remove(destroyEvent);
|
||||
destroyEvent();
|
||||
this.art.events.remove(this.events[index]);
|
||||
}
|
||||
this.$parent.innerHTML = '';
|
||||
}
|
||||
|
||||
update(settings = []) {
|
||||
const { option } = this.art;
|
||||
if (!option.setting) return;
|
||||
this.remove();
|
||||
this.events = [];
|
||||
this.cache = new Map();
|
||||
|
||||
@@ -163,9 +163,7 @@ export default class Component {
|
||||
}
|
||||
|
||||
for (let index = 0; index < item.events.length; index++) {
|
||||
const destroyEvent = item.events[index];
|
||||
this.art.events.remove(destroyEvent);
|
||||
destroyEvent();
|
||||
this.art.events.remove(item.events[index]);
|
||||
}
|
||||
|
||||
this.cache.delete(name);
|
||||
|
||||
Reference in new issue
Block a user