Add jsdoc

This commit is contained in:
Daniel Imms
2017-07-03 21:43:52 -07:00
parent 6223342890
commit 3e8ddd1966
+8
View File
@@ -123,10 +123,18 @@ export class Viewport {
ev.preventDefault();
};
/**
* Handles the touchstart event, recording the touch occurred.
* @param ev The touch event.
*/
public onTouchStart(ev: TouchEvent) {
this.lastTouchY = ev.touches[0].pageY;
};
/**
* Handles the touchmove event, scrolling the viewport if the position shifted.
* @param ev The touch event.
*/
public onTouchMove(ev: TouchEvent) {
let deltaY = this.lastTouchY - ev.touches[0].pageY;
this.lastTouchY = ev.touches[0].pageY;