Skip to content

Commit

Permalink
flow: Add TouchEvent types to params
Browse files Browse the repository at this point in the history
  • Loading branch information
borisyankov committed Oct 10, 2018
1 parent a415300 commit fd3d142
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/webview/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const handleLongPress = (e: TouchEvent) => {
});
};

documentBody.addEventListener('touchstart', e => {
documentBody.addEventListener('touchstart', (e: TouchEvent) => {
if (e.changedTouches[0].pageX < 20) {
return;
}
Expand All @@ -465,7 +465,7 @@ documentBody.addEventListener('touchstart', e => {
const isNearPositions = (x1: number = 0, y1: number = 0, x2: number = 0, y2: number = 0): boolean =>
Math.abs(x1 - x2) < 10 && Math.abs(y1 - y2) < 10;

documentBody.addEventListener('touchend', e => {
documentBody.addEventListener('touchend', (e: TouchEvent) => {
if (
isNearPositions(
lastTouchPositionX,
Expand All @@ -478,11 +478,11 @@ documentBody.addEventListener('touchend', e => {
}
});

documentBody.addEventListener('touchmove', e => {
documentBody.addEventListener('touchmove', (e: TouchEvent) => {
lastTouchEventTimestamp = 0;
});

documentBody.addEventListener('drag', e => {
documentBody.addEventListener('drag', (e: DragEvent) => {
lastTouchEventTimestamp = 0;
});

Expand Down

0 comments on commit fd3d142

Please sign in to comment.