add the id to container dom

This commit is contained in:
Harvey committed 2021-12-03 08:46:02 +08:00
1 parent 7584aeafe3
commit 44f3665a55
4 files changed
+11 -10

No files matched your search

+2 -2
View File
@@ -29,6 +29,8 @@ const instances = [];
export default class Artplayer extends Emitter {
constructor(option) {
super();
this.id = ++id;
this.option = validator(utils.mergeDeep(Artplayer.option, option), scheme);
this.isFocus = false;
this.isDestroy = false;
@@ -58,8 +60,6 @@ export default class Artplayer extends Emitter {
this.mobile = new Mobile(this);
}
id += 1;
this.id = id;
instances.push(this);
}
+1
View File
@@ -135,6 +135,7 @@ export default class Template {
this.$contextmenu = this.query('.art-contextmenus');
this.$player.style.setProperty('--theme', theme);
this.$container.dataset.artId = this.art.id;
if (backdrop) {
addClass(this.$settingInner, 'art-backdrop-filter');