Home Reference Source Test
public class | source

Tap

Extends:

Gesture → Tap

A Tap is defined as a touchstart to touchend event in quick succession.

Test:

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructor function for the Tap class.

Member Summary

Public Members
public

The maximum delay between a touchstart and touchend can be configured in milliseconds.

public

The minimum amount between a touchstart and a touchend can be configured in milliseconds.

public

The number of inputs to trigger a Tap can be variable, and the maximum number being a factor of the browser.

public

A move tolerance in pixels allows some slop between a user's start to end events. This allows the Tap gesture to be triggered more easily.

public

The type of the Gesture.

Method Summary

Public Methods
public

end(inputs: Array): null | Object

Event hook for the end of a gesture.

public

move(inputs: Array, state: Object): null

Event hook for the move of a gesture.

public

start(inputs: Array): null

Event hook for the start of a gesture.

Inherited Summary

From class Gesture
public

The unique identifier for each gesture determined at bind time by the state object.

public

The generic string type of gesture ('expand'|'pan'|'pinch'|'rotate'|'swipe'|'tap').

public

end(inputs: Array): null | Object

end() - Event hook for the move of a gesture

public

Return the id of the event.

public

getType() - Returns the generic type of the gesture

public

move(inputs: Array, state: Object): null | Object

move() - Event hook for the move of a gesture

public

setId(id: String)

Set the id of the gesture to be called during an event

public

setType(type: String)

Set the type of the gesture to be called during an event

public

start(inputs: Array): null | Object

start() - Event hook for the start of a gesture

public

update(object: *)

Updates internal properties with new ones, only if the properties exist.

Public Constructors

public constructor(options: Object) source

Constructor function for the Tap class.

Override:

Gesture#constructor

Params:

NameTypeAttributeDescription
options Object
  • optional

The options object.

options.minDelay Number
  • optional
  • default: 0

The minimum delay between a touchstart and touchend can be configured in milliseconds.

options.maxDelay Number
  • optional
  • default: 300

The maximum delay between a touchstart and touchend can be configured in milliseconds.

options.numInputs Number
  • optional
  • default: 1

Number of inputs for the Tap gesture.

options.tolerance Number
  • optional
  • default: 10

The tolerance in pixels a user can move.

Public Members

public maxDelay: Number source

The maximum delay between a touchstart and touchend can be configured in milliseconds. The maximum delay starts to count down when the expected number of inputs are on the screen, and ends when ALL inputs are off the screen.

public minDelay: Number source

The minimum amount between a touchstart and a touchend can be configured in milliseconds. The minimum delay starts to count down when the expected number of inputs are on the screen, and ends when ALL inputs are off the screen.

public numInputs: Number source

The number of inputs to trigger a Tap can be variable, and the maximum number being a factor of the browser.

public tolerance: number source

A move tolerance in pixels allows some slop between a user's start to end events. This allows the Tap gesture to be triggered more easily.

public type: String source

The type of the Gesture.

Override:

Gesture#type

Public Methods

public end(inputs: Array): null | Object source

Event hook for the end of a gesture. Determines if this the tap event can be fired if the delay and tolerance constraints are met. Also waits for all of the inputs to be off the screen before determining if the gesture is triggered.

Override:

Gesture#end

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen.

Return:

null | Object

null if the gesture is not to be emitted, Object with information otherwise. Returns the interval time between start and end events.

public move(inputs: Array, state: Object): null source

Event hook for the move of a gesture. The Tap event reaches here if the user starts to move their input before an 'end' event is reached.

Override:

Gesture#move

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen.

state Object

The state object of the current region.

Return:

null

Tap does not trigger on a move event.

public start(inputs: Array): null source

Event hook for the start of a gesture. Keeps track of when the inputs trigger the start event.

Override:

Gesture#start

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen.

Return:

null

Tap does not trigger on a start event.