only edge scroll in fullscreen (enabled by double-click)

This commit is contained in:
Tomáš Mládek 2021-01-10 13:25:49 +01:00
parent a6bc042876
commit 77e20afc61
2 changed files with 10 additions and 1 deletions

View file

@ -18,6 +18,7 @@ export default defineComponent({
<style>
html, body {
overflow: hidden;
background-color: white;
}
html, body, #app, #root {

View file

@ -39,7 +39,12 @@ export default defineComponent({
// PanZoom
const pz = createPanZoom(element, {
smoothScroll: false,
zoomSpeed: 0.05
zoomSpeed: 0.05,
zoomDoubleClickSpeed: 1,
onDoubleClick: function (e) {
document.body.requestFullscreen();
return true;
}
});
panzoom.value = pz;
@ -51,6 +56,9 @@ export default defineComponent({
window.addEventListener("mousemove", (ev) => {
clearTimeout(edgeScrollInterval);
edgeScrollInterval = undefined;
if (!document.fullscreenElement) {
return;
}
let horizontalShift: number;
let verticalShift: number;