Frontend: Improve touch event listeners #242
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
c19cefd5df
commit
6b32598c3b
2 changed files with 6 additions and 4 deletions
|
@ -340,10 +340,11 @@
|
||||||
},
|
},
|
||||||
onTouchMove(e) {
|
onTouchMove(e) {
|
||||||
const y = e.touches[0].pageY;
|
const y = e.touches[0].pageY;
|
||||||
|
const h = window.document.documentElement.scrollHeight - window.document.documentElement.clientHeight;
|
||||||
|
|
||||||
if(window.scrollY >= window.innerHeight && y < this.touchStart + 200) {
|
if(window.scrollY >= h - 200 && y < this.touchStart + 100) {
|
||||||
this.loadMore();
|
this.loadMore();
|
||||||
} else if (window.scrollY === 0 && y > this.touchStart + 200) {
|
} else if (window.scrollY === 0 && y > this.touchStart + 250) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -339,10 +339,11 @@
|
||||||
},
|
},
|
||||||
onTouchMove(e) {
|
onTouchMove(e) {
|
||||||
const y = e.touches[0].pageY;
|
const y = e.touches[0].pageY;
|
||||||
|
const h = window.document.documentElement.scrollHeight - window.document.documentElement.clientHeight;
|
||||||
|
|
||||||
if(window.scrollY >= window.innerHeight && y < this.touchStart + 200) {
|
if(window.scrollY >= h - 200 && y < this.touchStart + 100) {
|
||||||
this.loadMore();
|
this.loadMore();
|
||||||
} else if (window.scrollY === 0 && y > this.touchStart + 200) {
|
} else if (window.scrollY === 0 && y > this.touchStart + 250) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue