Home Reference Source
public class | source

TouchSensor

Extends:

* → TouchSensor

This sensor picks up native browser touch events and dictates drag operations

Constructor Summary

Public Constructor
public

constructor(containers: HTMLElement[] | NodeList | HTMLElement, options: Object)

TouchSensor constructor.

Member Summary

Public Members
public
public

Closest scrollable container so accidental scroll can cancel long touch

public
public

TimeoutID for long touch

public

touchMoved indicates if touch has moved during tapTimeout

Method Summary

Public Methods
public

attach()

Attaches sensors event listeners to the DOM

public

detach()

Detaches sensors event listeners to the DOM

Private Methods
private

Scroll handler, cancel potential drag and allow scroll on iOS or other touch devices

private

[onTouchEnd](event: Event)

Touch end handler

private

[onTouchHold](event: Event, container: HTMLElement): *

Touch hold handler

private

[onTouchMove](event: Event)

Touch move handler

private

[onTouchStart](event: Event)

Touch start handler

Public Constructors

public constructor(containers: HTMLElement[] | NodeList | HTMLElement, options: Object) source

TouchSensor constructor.

Params:

NameTypeAttributeDescription
containers HTMLElement[] | NodeList | HTMLElement

Containers

options Object

Options

Public Members

public currentContainer: * source

public currentScrollableParent: HTMLElement source

Closest scrollable container so accidental scroll can cancel long touch

Properties:

NameTypeAttributeDescription
currentScrollableParent *

public dragging: * source

public tapTimeout: Number source

TimeoutID for long touch

Properties:

NameTypeAttributeDescription
tapTimeout *

public touchMoved: Boolean source

touchMoved indicates if touch has moved during tapTimeout

Properties:

NameTypeAttributeDescription
touchMoved *

Public Methods

public attach() source

Attaches sensors event listeners to the DOM

public detach() source

Detaches sensors event listeners to the DOM

Private Methods

private [onScroll]() source

Scroll handler, cancel potential drag and allow scroll on iOS or other touch devices

private [onTouchEnd](event: Event) source

Touch end handler

Params:

NameTypeAttributeDescription
event Event

Touch end event

private [onTouchHold](event: Event, container: HTMLElement): * source

Touch hold handler

Params:

NameTypeAttributeDescription
event Event

Touch start event

container HTMLElement

Container element

Return:

*

private [onTouchMove](event: Event) source

Touch move handler

Params:

NameTypeAttributeDescription
event Event

Touch move event

private [onTouchStart](event: Event) source

Touch start handler

Params:

NameTypeAttributeDescription
event Event

Touch start event