Skip to content

Commit

Permalink
flow: Event handlers, except .target
Browse files Browse the repository at this point in the history
  • Loading branch information
borisyankov committed Sep 21, 2018
1 parent fbd7b65 commit 2384f33
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/webview/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ document.addEventListener('message', e => {
scrollEventsDisabled = false;
});

documentBody.addEventListener('click', e => {
documentBody.addEventListener('click', (e: any) => {
e.preventDefault();
lastTouchEventTimestamp = 0;

Expand Down Expand Up @@ -410,7 +410,7 @@ const handleLongPress = (e: TouchEvent) => {
});
};

documentBody.addEventListener('touchstart', e => {
documentBody.addEventListener('touchstart', (e: TouchEvent) => {
if (e.changedTouches[0].pageX < 20) {
return;
}
Expand All @@ -421,7 +421,7 @@ documentBody.addEventListener('touchstart', e => {
setTimeout(() => handleLongPress(e), 500);
});

documentBody.addEventListener('touchend', e => {
documentBody.addEventListener('touchend', (e: TouchEvent) => {
if (
isNearPositions(
lastTouchPositionX,
Expand All @@ -434,11 +434,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 2384f33

Please sign in to comment.