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