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
public
public

TimeoutID for managing delay

public

touchMoved indicates if touch has moved during tapTimeout

Private Members
private

pageX: *

Save pageX coordinates for delay drag

private

pageY: *

Save pageY coordinates for delay drag

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

[onDistanceChange](event: Event)

Touch move handler prior to drag start.

private

[onTouchEnd](event: Event)

Touch end handler

private

[onTouchMove](event: Event)

Mouse move handler while dragging

private

[onTouchStart](event: Event)

Touch start handler

private

Start the drag

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 onTouchStartAt: * source

public startEvent: * source

public tapTimeout: Number source

TimeoutID for managing delay

Properties:

NameTypeAttributeDescription
tapTimeout *

public touchMoved: Boolean source

touchMoved indicates if touch has moved during tapTimeout

Properties:

NameTypeAttributeDescription
touchMoved *

Private Members

private pageX: * source

Save pageX coordinates for delay drag

Properties:

NameTypeAttributeDescription
pageX Numbre

private pageY: * source

Save pageY coordinates for delay drag

Properties:

NameTypeAttributeDescription
pageY Numbre

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 [onDistanceChange](event: Event) source

Touch move handler prior to drag start.

Params:

NameTypeAttributeDescription
event Event

Touch move event

private [onTouchEnd](event: Event) source

Touch end handler

Params:

NameTypeAttributeDescription
event Event

Touch end event

private [onTouchMove](event: Event) source

Mouse move handler while dragging

Params:

NameTypeAttributeDescription
event Event

Touch move event

private [onTouchStart](event: Event) source

Touch start handler

Params:

NameTypeAttributeDescription
event Event

Touch start event

private [startDrag]() source

Start the drag