dojox/gesture/Base (version 1.10)

Usage

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

See the dojox/gesture/Base 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 e.g. 'tap' is a default event of dojox.gesture.tap
  • subEventsA list of sub events e.g ['hold', 'doubletap'], used by being combined with defaultEvent like 'tap.hold', 'tap.doubletap' etc.
  • 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
  • _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) Process the 'press' phase of a gesture
  • release(data,e) Process the 'release' phase of a gesture
  • 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/Base

Default event e.g. 'tap' is a default event of dojox.gesture.tap

subEvents
Defined by: dojox/gesture/Base

A list of sub events e.g ['hold', 'doubletap'], used by being combined with defaultEvent like 'tap.hold', 'tap.doubletap' etc.

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
_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/Base

Process the 'press' phase of a gesture

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

Process the 'release' phase of a gesture

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

Release the lock

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