Use CSS to prevent pull-to-refresh in Chrome

This commit is contained in:
Florine W. Dekker 2019-11-02 14:29:05 +01:00
parent e3b2bd1bf2
commit 606259e8ec
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
3 changed files with 3 additions and 4 deletions

View File

@ -50,6 +50,7 @@ a:link.fileLink, a:visited.fileLink {
body {
background-color: black;
overscroll-behavior-y: contain;
}
#terminal {

View File

@ -31,11 +31,11 @@ export const emptyFunction = () => {
export function addOnLoad(fun: () => void): void {
const oldOnLoad = window.onload || emptyFunction;
window.onload = (() => {
window.onload = () => {
// @ts-ignore: Call works without parameters as well
oldOnLoad();
fun();
});
};
}
/**

View File

@ -67,8 +67,6 @@ export class Terminal {
scrollStartPosition = event.changedTouches[0].clientY;
}, {passive: true});
this.terminal.addEventListener("touchmove", (event: TouchEvent) => {
event.preventDefault();
const newPosition = event.changedTouches[0].clientY;
const diff = scrollStartPosition - newPosition;
if (Math.abs(diff) < this.lineHeight)