mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 04:36:15 -08:00
重置ID
This commit is contained in:
1 parent
ddcf432717
commit
8148973d39
5 files changed
+9
-19
No files matched your search
@@ -8,6 +8,7 @@ import close from './close';
|
||||
let id = 0;
|
||||
export default class Contextmenu {
|
||||
constructor(art) {
|
||||
id = 0;
|
||||
this.art = art;
|
||||
this.init();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import Quality from './quality';
|
||||
let id = 0;
|
||||
export default class Controls {
|
||||
constructor(art) {
|
||||
id = 0;
|
||||
this.art = art;
|
||||
this.art.on('firstCanplay', () => {
|
||||
this.init();
|
||||
|
||||
@@ -3,6 +3,7 @@ import { append, setStyles, setStyle, insertByIndex } from './utils';
|
||||
let id = 0;
|
||||
export default class Layers {
|
||||
constructor(art) {
|
||||
id = 0;
|
||||
this.art = art;
|
||||
this.add = this.add.bind(this);
|
||||
this.art.option.layers.forEach(item => {
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { setStyle, append } from '../utils';
|
||||
import { setStyle, append, insertByIndex } from '../utils';
|
||||
import Common from './common';
|
||||
|
||||
let id = 0;
|
||||
export default class Setting {
|
||||
constructor(art) {
|
||||
id = 0;
|
||||
this.art = art;
|
||||
this.state = false;
|
||||
this.$settings = [];
|
||||
if (art.option.setting) {
|
||||
this.init();
|
||||
this.mount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +28,7 @@ export default class Setting {
|
||||
}
|
||||
|
||||
add(setting) {
|
||||
const { refs } = this.art;
|
||||
const { option } = setting;
|
||||
if (option && !option.disable) {
|
||||
id++;
|
||||
@@ -39,23 +39,12 @@ export default class Setting {
|
||||
$setting.dataset.settingIndex = option.index || id;
|
||||
append($setting, `<div class="art-setting-header">${this.art.i18n.get(title)}</div>`);
|
||||
append($setting, '<div class="art-setting-body"></div>');
|
||||
this.$settings.push($setting);
|
||||
setting.apply && setting.apply(this.art, $setting);
|
||||
this[name] = setting;
|
||||
this[name] = $setting;
|
||||
insertByIndex(refs.$settingBody, $setting, option.index || id);
|
||||
}
|
||||
}
|
||||
|
||||
mount() {
|
||||
this.$settings
|
||||
.sort(
|
||||
(a, b) =>
|
||||
Number(a.dataset.settingIndex) - Number(b.dataset.settingIndex)
|
||||
)
|
||||
.forEach($setting => {
|
||||
append(this.art.refs.$settingBody, $setting);
|
||||
});
|
||||
}
|
||||
|
||||
show() {
|
||||
const { refs: { $setting }, i18n, notice } = this.art;
|
||||
setStyle($setting, 'display', 'flex');
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
|
||||
pointer-events: none;
|
||||
.art-layer {
|
||||
position: absolute;
|
||||
pointer-events: all;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user