fix control

This commit is contained in:
Harvey Zack committed 2023-10-24 23:42:23 +08:00
1 parent c1780c3137
commit 9de1d74b7a
3 files changed
+25 -19

No files matched your search

+13 -9
View File
@@ -20,17 +20,17 @@ export default class Control extends Component {
this.name = 'control';
this.timer = Date.now();
const {
proxy,
constructor,
template: { $video },
} = art;
const { constructor } = art;
proxy($video, ['click', 'mousemove'], (event) => {
art.on('mousemove', () => {
if (!isMobile) {
this.show = true;
}
});
art.on('click', () => {
if (isMobile) {
if (event.type === 'click') {
this.show = !this.show;
}
this.toggle();
} else {
this.show = true;
}
@@ -64,6 +64,10 @@ export default class Control extends Component {
return super.show;
}
toggle() {
this.show = !this.show;
}
init() {
const { option } = this.art;