Class Index | File Index

Classes


Class gui.EventManager


Defined in: EventManager.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
gui.EventManager(odtDocument)
Event wiring and management abstraction layer This class contains workarounds for various behaviour issues with events cross-browser.
Method Summary
Method Attributes Method Name and Description
 
addFilter(eventName, filter)
Add an event filter that is able to reject events from being processed
<inner>  
clearTimeout(timer)
<inner>  
Adds a class 'webodf-touchEnabled' to the canvas
 
destroy(callback)
<inner>  
Prevent the event trap from receiving focus
<inner>  
emitDragEvent(event, cachedState, callback)
Drag events are generated whenever an element with class 'webodf-draggable' is touched and subsequent finger movements lie on the same element.
<inner>  
emitDragStopEvent(event, cachedState, callback)
Drag-stop events are generated whenever an touchend is preceded by a drag event.
<inner>  
emitLongPressEvent(event, cachedState, callback)
A long-press occurs when a finger is placed against the screen and not lifted or moved before a specific short duration (400ms seems approximately the time iOS takes).
<inner>  
Allow the event trap to receive focus
<inner>  
Find the all scrollable ancestor for the specified element
<inner>  
Return event focus back to the event manager
<inner>  
getDelegateForEvent(eventName, shouldCreate)
Get an event delegate for the requested event name
 
Returns the event trap div
<inner>  
<inner>  
Returns true if the event manager is currently receiving events
 
removeFilter(eventName, filter)
Remove a registered event filter
 
setEditing(editable)
Sets to true when in edit mode; otherwise false
<inner>  
setTimeout(fn, duration)
<inner>  
subscribe(eventName, handler)
<inner>  
unsubscribe(eventName, handler)
Class Detail
gui.EventManager(odtDocument)
Event wiring and management abstraction layer This class contains workarounds for various behaviour issues with events cross-browser. Additionally, this class provides a mechanism for returning event focus back to the SessionController when it has been lost to an external source.
Parameters:
{!ops.OdtDocument} odtDocument
Method Detail
addFilter(eventName, filter)
Add an event filter that is able to reject events from being processed
Parameters:
{!string} eventName
{!function(!Event):!boolean} filter

<inner> {undefined} clearTimeout(timer)
Parameters:
{!number} timer
Returns:
{undefined}

<inner> {undefined} declareTouchEnabled()
Adds a class 'webodf-touchEnabled' to the canvas
Returns:
{undefined}

{undefined} destroy(callback)
Parameters:
{!function(!Error=)} callback
passing an error object in case of error
Returns:
{undefined}

<inner> {undefined} disableTrapSelection()
Prevent the event trap from receiving focus
Returns:
{undefined}

<inner> {undefined} emitDragEvent(event, cachedState, callback)
Drag events are generated whenever an element with class 'webodf-draggable' is touched and subsequent finger movements lie on the same element. This prevents the default action of touchmove, i.e. usually scrolling.
Parameters:
{!Event} event
{!Object} cachedState
{!function(!Object):undefined} callback
Returns:
{undefined}

<inner> {undefined} emitDragStopEvent(event, cachedState, callback)
Drag-stop events are generated whenever an touchend is preceded by a drag event.
Parameters:
{!Event} event
{!Object} cachedState
{!function(!Object):undefined} callback
Returns:
{undefined}

<inner> {undefined} emitLongPressEvent(event, cachedState, callback)
A long-press occurs when a finger is placed against the screen and not lifted or moved before a specific short duration (400ms seems approximately the time iOS takes).
Parameters:
{!Event} event
{!Object} cachedState
{!function(!Object):undefined} callback
Returns:
{undefined}

<inner> {undefined} enableTrapSelection()
Allow the event trap to receive focus
Returns:
{undefined}

<inner> {!Array.} findScrollableParents(element)
Find the all scrollable ancestor for the specified element
Parameters:
{Element} element
Returns:
{!Array.}

<inner> focus()
Return event focus back to the event manager

<inner> {EventDelegate|CompoundEvent} getDelegateForEvent(eventName, shouldCreate)
Get an event delegate for the requested event name
Parameters:
{!string} eventName
{!boolean} shouldCreate
Create a delegate for the requested event if it doesn't exist
Returns:
{EventDelegate|CompoundEvent}

{!HTMLInputElement} getEventTrap()
Returns the event trap div
Returns:
{!HTMLInputElement}

<inner> {Node} getTarget(e)
Parameters:
{!Event} e
Returns:
{Node}

<inner> {boolean} hasFocus()
Returns true if the event manager is currently receiving events
Returns:
{boolean}

removeFilter(eventName, filter)
Remove a registered event filter
Parameters:
{!string} eventName
{!function(!Event):!boolean} filter

{undefined} setEditing(editable)
Sets to true when in edit mode; otherwise false
Parameters:
{!boolean} editable
Returns:
{undefined}

<inner> {!number} setTimeout(fn, duration)
Parameters:
{!Function} fn
{!number} duration
Returns:
{!number}

<inner> {undefined} subscribe(eventName, handler)
Parameters:
{!string} eventName
{function(!Event)|function()} handler
Returns:
{undefined}

<inner> {undefined} unsubscribe(eventName, handler)
Parameters:
{!string} eventName
{function(!Event)|function()} handler
Returns:
{undefined}

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Aug 06 2015 04:10:40 GMT+0200 (MESZ)