Skip to content

Commit

Permalink
Do not hide on idle on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Besson committed Apr 27, 2021
1 parent 6257609 commit 076dc6d
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/components/image-viewer/ImageViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ const exitFullscreen = function () {
}
};
const idleDuration = 3000;
export default {
swiper: null,
zt: null,
Expand Down Expand Up @@ -197,14 +195,6 @@ export default {
this.close();
}
});
if (!this.$screen.isMobile) {
// detect idle
window.addEventListener('mousemove', this.resetTimer);
window.addEventListener('keypress', this.resetTimer);
this.timer = setTimeout(() => {
this.hideButtons = true;
}, idleDuration);
}
});
if (this.$screen.isMobile) {
this.$options.swiper.on('click', this.toggleButtons);
Expand All @@ -231,10 +221,6 @@ export default {
this.zt.unbind(this.$refs.container);
this.zt = null;
}
window.removeEventListener('mousemove', this.resetTimer);
window.removeEventListener('keypress', this.resetTimer);
clearTimeout(this.timer);
this.hideButtons = false;
// if we closed without hitting back, go back once in history
Expand All @@ -244,14 +230,6 @@ export default {
}
},
resetTimer() {
this.hideButtons = false;
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.hideButtons = true;
}, idleDuration);
},
onKeydown(event) {
if (event.key === 'Escape') {
this.close();
Expand Down

0 comments on commit 076dc6d

Please sign in to comment.