Home Reference Source Test
public class | source

Pan

Extends:

Gesture → Pan

A Pan is defined as a normal movement in any direction on a screen. Pan gestures do not track start events and can interact with pinch and expand gestures.

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructor function for the Pan class.

Member Summary

Public Members
public

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

public

The minimum amount in pixels the pan must move until it is fired.

public

The type of the Gesture.

Method Summary

Public Methods
public

end(inputs: Array): null

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

public

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

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

public

start(inputs: *)

start() - 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 Pan class.

Override:

Gesture#constructor

Params:

NameTypeAttributeDescription
options Object
  • optional

The options object.

options.numInputs Number
  • optional
  • default: 1

Number of inputs for the Pan gesture.

options.threshold Number
  • optional
  • default: 1

The minimum number of pixels the input has to move to trigger this gesture.

Public Members

public numInputs: Number source

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

public threshold: Number source

The minimum amount in pixels the pan must move until it is fired.

public type: String source

The type of the Gesture.

Override:

Gesture#type

Public Methods

public end(inputs: Array): null source

end() - Event hook for the end of a gesture. If the gesture has at least fired once, then it ends on the first end event such that any remaining inputs will not trigger the event until all inputs have reached the touchend event. Any touchend->touchstart events that occur before all inputs are fully off the screen should not fire.

Override:

Gesture#end

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen

Return:

null

null if the gesture is not to be emitted, Object with information otherwise.

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

move() - Event hook for the move of a gesture. Fired whenever the input length is met, and keeps a boolean flag that the gesture has fired at least once.

Override:

Gesture#move

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen

state Object

The state object of the current region.

Return:

Object

Returns the distance in pixels between the two inputs.

public start(inputs: *) source

start() - Event hook for the start of a gesture. Marks each input as active, so it can invalidate any end events.

Override:

Gesture#start

Params:

NameTypeAttributeDescription
inputs *