Skip to content

Commit

Permalink
Add touchstart and touchend events.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetroff committed Mar 10, 2017
1 parent 12f578a commit 1e61a22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/events.md
Expand Up @@ -36,3 +36,13 @@ Fired when the mouse button is pressed. Passes `MouseEvent` to handler.
## `mouseup`

Fired when the mouse button is released. Passes `MouseEvent` to handler.


## `touchstart`

Fired when a touch starts. Passes `TouchEvent` to handler.


## `touchend`

Fired when a touch ends. Passes `TouchEvent` to handler.
3 changes: 3 additions & 0 deletions src/js/pannellum.js
Expand Up @@ -792,6 +792,7 @@ function onDocumentTouchStart(event) {
onPointerDownYaw = config.yaw;
onPointerDownPitch = config.pitch;

fireEvent('touchstart', event);
animateInit();
}

Expand Down Expand Up @@ -852,6 +853,8 @@ function onDocumentTouchEnd() {
}
onPointerDownPointerDist = -1;
latestInteraction = Date.now();

fireEvent('touchend', event);
}

var pointerIDs = [],
Expand Down

0 comments on commit 1e61a22

Please sign in to comment.