Class: PanEmitter

PanEmitter

new PanEmitter(options)

Class that emits or provides support for pan gestures/events.
Parameters:
Name Type Description
options Object Additional options
Properties
Name Type Argument Default Description
emitter Emitter | Object <optional>
<nullable>
{} Emitter instance or options on which to emit events
element Element Element for which to bind events
hammer Hammer Hammer instance for the element (required by base class)
enabled boolean <optional>
<nullable>
false Whether to enable this emitter
horizontal boolean <optional>
<nullable>
false Whether to monitor horizontal pan gestures.
vertical boolean <optional>
<nullable>
true Whether to monitor vertical pan gestures.
threshold number <optional>
<nullable>
0 Threshold distance before pan gestures are detected.
Source:

Extends

Members

defaultOptions

Default options hash for constructor.
Source:

direction

Hammer direction enum value to use.
Source:

enabled

Indicates if this emitter is enabled (listens for events, and forwards them on the Emitter)
Inherited From:
Source:

horizontal

Whether to emit events for horizontal pan gestures.
Source:

threshold

Pixel distance before pan events are emitted.
Source:

vertical

Whether to emit events for horizontal pan gestures.
Source:

Methods

bind() → {undefined}

Binds all events (element and Hammer)
Inherited From:
Source:
Returns:
Type
undefined

bindElementEvents() → {undefined}

Binds all of the Element-level events specified by GestureEmitter#getElementEvents
Inherited From:
Source:
Returns:
Type
undefined

bindHammerEvents() → {undefined}

Binds to Hammer events specified by GestureEmitter#getHammerEvents
Inherited From:
Source:
Returns:
Type
undefined

destroy() → {undefined}

Destroys this instance by unbinding from all bound events (Element-level, and Hammer).
Inherited From:
Source:
Returns:
Type
undefined

getElementEvents() → {undefined}

Gets a map of Element/DOM event names to method names for which to bind. This method should be implemented by a subclass, if the subclass is interested in DOM element-level events.
Inherited From:
Source:
Returns:
Type
undefined

getHammerEvents()

Returns the map of Hammer.js events to which to bind.
Source:

onPanMove(e) → {undefined}

Called when a panmove event is detected by Hammer.js.
Parameters:
Name Type Description
e Hammer event object
Source:
Fires:
Returns:
Type
undefined

setElement(element) → {undefined}

Sets the Element monitored by this GestureEmitter
Parameters:
Name Type Description
element Element element to monitor
Inherited From:
Source:
Returns:
Type
undefined

setHammer(hammer) → {undefined}

Sets the Hammer instance for this GestureEmitter The Hammer instance also wraps the element, and recognizes gestures.
Parameters:
Name Type Description
hammer
Inherited From:
Source:
Returns:
Type
undefined

unbind() → {undefined}

Unbinds all events (element and Hammer)
Inherited From:
Source:
Returns:
Type
undefined

unbindElementEvents() → {undefined}

Unbinds all the Element-level events specified by GestureEmitter#getElementEvents
Inherited From:
Source:
Returns:
Type
undefined

unbindHammerEvents() → {undefined}

Unbinds from hammer events specified by GestureEmitter#getHammerEvents
Inherited From:
Source:
Returns:
Type
undefined

Events

gesture:pan:any

Event for a pan gesture in any direction.
Type:
Properties:
Name Type Description
type String the event type string
sender PanEmitter the sender of the event
data * the hammer event object
Source:
Returns:
Type
undefined

gesture:pan:cancel

Event for a pan cancel.
Type:
Properties:
Name Type Description
type String the event type string
sender PanEmitter the sender of the event
data * the hammer event object
Source:

gesture:pan:end

Event for a pan end.
Type:
Properties:
Name Type Description
type String the event type string
sender PanEmitter the sender of the event
data * the hammer event object
Source:

gesture:pan:start

Event for a pan start.
Type:
Properties:
Name Type Description
type String the event type string
sender PanEmitter the sender of the event
data * the hammer event object
Source:

gesture:pan:x

Event for a pan gesture in the horizontal direction.
Type:
Properties:
Name Type Description
type String the event type string
sender PanEmitter the sender of the event
data * the hammer event object
Source:

gesture:pan:y

Event for a pan gesture in the vertical direction.
Type:
Properties:
Name Type Description
type String the event type string
sender PanEmitter the sender of the event
data * the hammer event object
Source: