dojox/gesture/tap.Tap (version 1.10)

dojox/gesture/Base

Usage

var foo = new tap.Tap(args);
dojox/gesture/Base
Parameter Type Description
args undefined

See the dojox/gesture/tap.Tap reference documentation for more information.

Property Summary

  • _elementsList of elements that wraps target node and gesture data
  • _eventsThe complete list of supported gesture events with full name space e.g ['tap', 'tap.hold', 'tap.doubletap']
  • _lockThe dom node whose descendants are all locked for processing
  • defaultEventDefault event - 'tap'
  • doubleTapTimeout
  • holdThresholdThreshold(in milliseconds) for 'tap.hold'
  • subEventsList of sub events, used by being combined with defaultEvent as 'tap.hold', 'tap.doubletap'.
  • tapRadiusValid tap radius from previous touch point
  • touchOnlyWhether the gesture is touch-device only

Method Summary

  • _add(node,type,listener) Bind dojo/on handlers for both gesture event(e.g 'tab.hold') and underneath 'press'|'move'|'release' events
  • _cleanHandles(handles) Clean up on handles
  • _getGestureElement(node) Obtain a gesture element for the give node
  • _handle(eventType) Bind listen handler for the given gesture event(e.g. 'tap', 'tap.hold' etc.) the returned handle will be used internally by dojo/on
  • _initTap(data,e) Update the gesture data with new tap info
  • _isTap(data,e) Check whether it's an valid tap
  • _process(element,phase,e) Process and dispatch to appropriate phase handlers.
  • _remove(node,type) Check and remove underneath handlers if node is not being listened for 'this' gesture anymore, this happens when user removed all previous on() handlers.
  • cancel(data,e) Process the 'cancel' phase of a gesture
  • destroy() Release all handlers and resources
  • fire(node,event) Fire a gesture event and invoke registered listeners a simulated GestureEvent will also be sent along
  • init() Initialization works
  • isLocked(node) Check if the node is locked, isLocked(node) means whether it's a descendant of the currently locked node.
  • lock(node) Lock all descendants of the node.
  • move(data,e) Process the 'move' phase of a gesture
  • press(data,e) Overwritten, record initial tap info and register a timeout checker for 'tap.hold'
  • release(data,e) Overwritten, fire matched 'tap' or 'tap.doubletap' during touchend
  • unLock() Release the lock

Properties

_elements
Defined by: dojox/gesture/Base

List of elements that wraps target node and gesture data

_events
Defined by: dojox/gesture/Base

The complete list of supported gesture events with full name space e.g ['tap', 'tap.hold', 'tap.doubletap']

_lock
Defined by: dojox/gesture/Base

The dom node whose descendants are all locked for processing

defaultEvent
Defined by: dojox/gesture/tap

Default event - 'tap'

doubleTapTimeout
Defined by: dojox/gesture/tap
holdThreshold
Defined by: dojox/gesture/tap

Threshold(in milliseconds) for 'tap.hold'

subEvents
Defined by: dojox/gesture/tap

List of sub events, used by being combined with defaultEvent as 'tap.hold', 'tap.doubletap'.

tapRadius
Defined by: dojox/gesture/tap

Valid tap radius from previous touch point

touchOnly
Defined by: dojox/gesture/Base

Whether the gesture is touch-device only

Methods

_add(node,type,listener)
Defined by dojox/gesture/Base

Bind dojo/on handlers for both gesture event(e.g 'tab.hold') and underneath 'press'|'move'|'release' events

Parameter Type Description
node Dom
type String
listener function
Returns:undefined
_cleanHandles(handles)
Defined by dojox/gesture/Base

Clean up on handles

Parameter Type Description
handles Object
_getGestureElement(node)
Defined by dojox/gesture/Base

Obtain a gesture element for the give node

Parameter Type Description
node Dom
Returns:undefined
_handle(eventType)
Defined by dojox/gesture/Base

Bind listen handler for the given gesture event(e.g. 'tap', 'tap.hold' etc.) the returned handle will be used internally by dojo/on

Parameter Type Description
eventType String
Returns:function
_initTap(data,e)
Defined by dojox/gesture/tap

Update the gesture data with new tap info

Parameter Type Description
data Object
e Event
_isTap(data,e)
Defined by dojox/gesture/tap

Check whether it's an valid tap

Parameter Type Description
data Object
e Event
Returns:boolean
_process(element,phase,e)
Defined by dojox/gesture/Base

Process and dispatch to appropriate phase handlers. Also provides the machinery for managing gesture bubbling.

  1. e._locking is used to make sure only the most inner node will be processed for the same gesture, suppose we have:

    on(inner, dojox.gesture.tap, func1); on(outer, dojox.gesture.tap, func2); only the inner node will be processed by tap gesture, once matched,

the 'tap' event will be bubbled up from inner to outer, dojo.StopEvent(e) can be used at any level to stop the 'tap' event.

  1. Once a node starts being processed, all it's descendant nodes will be locked. The same gesture won't be processed on its descendant nodes until the lock is released.
Parameter Type Description
element Object

Gesture element

phase String

Phase of a gesture to be processed, might be 'press'|'move'|'release'|'cancel'

e Event

Native event

_remove(node,type)
Defined by dojox/gesture/Base

Check and remove underneath handlers if node is not being listened for 'this' gesture anymore, this happens when user removed all previous on() handlers.

Parameter Type Description
node Dom
type String
cancel(data,e)
Defined by dojox/gesture/Base

Process the 'cancel' phase of a gesture

Parameter Type Description
data undefined
e undefined
destroy()
Defined by dojox/gesture/Base

Release all handlers and resources

fire(node,event)
Defined by dojox/gesture/Base

Fire a gesture event and invoke registered listeners a simulated GestureEvent will also be sent along

Parameter Type Description
node DomNode

Target node to fire the gesture

event Object

An object containing specific gesture info e.g {type: 'tap.hold'|'swipe.left'), ...} all these properties will be put into a simulated GestureEvent when fired. Note - Default properties in a native Event won't be overwritten, see on.emit() for more details.

init()
Defined by dojox/gesture/Base

Initialization works

isLocked(node)
Defined by dojox/gesture/Base

Check if the node is locked, isLocked(node) means whether it's a descendant of the currently locked node.

Parameter Type Description
node undefined
Returns:boolean
lock(node)
Defined by dojox/gesture/Base

Lock all descendants of the node.

Parameter Type Description
node Dom
move(data,e)
Defined by dojox/gesture/Base

Process the 'move' phase of a gesture

Parameter Type Description
data undefined
e undefined
press(data,e)
Defined by dojox/gesture/tap

Overwritten, record initial tap info and register a timeout checker for 'tap.hold'

Parameter Type Description
data Object
e Event
release(data,e)
Defined by dojox/gesture/tap

Overwritten, fire matched 'tap' or 'tap.doubletap' during touchend

Parameter Type Description
data Object
e Event
unLock()
Defined by dojox/gesture/Base

Release the lock

Error in the documentation? Can’t find what you are looking for? Let us know!