Class SweetDevRia.EventHelper
Events utility class
Defined in: EventHelper.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
<static> |
SweetDevRia.EventHelper.MOUSE_LEFT
Static methods
|
Method Attributes | Method Name and Description |
---|---|
<static> |
SweetDevRia.EventHelper.addListener(element, type, handler, a, bOverride)
Add an event handler.
|
<static> |
SweetDevRia.EventHelper.addPostLoadListener(element, handler, a, bOverride)
Add a load event handler to be executed after others load events.
|
<static> |
SweetDevRia.EventHelper.addPreLoadListener(element, handler, a, bOverride)
Add a load event handler to be executed before others load events.
|
<static> |
SweetDevRia.EventHelper.customEvent(Event, src)
Create a specific event
|
<static> |
SweetDevRia.EventHelper.fireMouseEvent(DOM, eventType, x, y, button)
Generate a mouse event
|
<static> |
SweetDevRia.EventHelper.getEvent(evt)
Return a cross browser and standard event
|
<static> |
SweetDevRia.EventHelper.removeListener(element, type, handler, fn)
Remove an event handler.
|
<static> |
SweetDevRia.EventHelper.runLoadListeners()
Run all the load events in the right order.
|
<static> |
SweetDevRia.EventHelper.stopPropagation()
Stop event propagation.
|
Field Detail
<static>
SweetDevRia.EventHelper.MOUSE_LEFT
Static methods
Method Detail
<static>
{boolean}
SweetDevRia.EventHelper.addListener(element, type, handler, a, bOverride)
Add an event handler.
- Parameters:
- {HtmlElement} element
- DOM object
- {String} type
- Event type (i.e. "mousedown")
- {function} handler
- Function to call when event is detected
- {object} a
- arbitraryObject that will be passed has an parameter to the handler
- {boolean} bOverride
- If true, the obj passed in becomes the execution scope of the listener
- Returns:
- {boolean} True if the action was successful or defered, false if one or more of the elements could not have the event bound to it.
<static>
{int}
SweetDevRia.EventHelper.addPostLoadListener(element, handler, a, bOverride)
Add a load event handler to be executed after others load events.
- Parameters:
- {HtmlElement} element
- DOM object
- {function} handler
- Function to call when event is detected
- {object} a
- arbitraryObject that will be passed has an parameter to the handler
- {boolean} bOverride
- If true, the obj passed in becomes the execution scope of the listener
- Returns:
- {int} The number of postLoad events actually registered.
<static>
{int}
SweetDevRia.EventHelper.addPreLoadListener(element, handler, a, bOverride)
Add a load event handler to be executed before others load events.
- Parameters:
- {HtmlElement} element
- DOM object
- {function} handler
- Function to call when event is detected
- {object} a
- arbitraryObject that will be passed has an parameter to the handler
- {boolean} bOverride
- If true, the obj passed in becomes the execution scope of the listener
- Returns:
- {int} The number of preLoad events actually registered.
<static>
{CustomEvent}
SweetDevRia.EventHelper.customEvent(Event, src)
Create a specific event
- Parameters:
- {String} Event
- type
- {Object} src
- Source object
- Returns:
- event
<static>
SweetDevRia.EventHelper.fireMouseEvent(DOM, eventType, x, y, button)
Generate a mouse event
- Parameters:
- {HTMLElement} DOM
- Object where generate mouse click
- {String} eventType
- Event type (i.e. 'mousedown', 'mouseup', etc)
- {int} x
- X position where click
- {int} y
- Y position where click
- {int} button
- Mouse button
<static>
{event}
SweetDevRia.EventHelper.getEvent(evt)
Return a cross browser and standard event
- Parameters:
- {event} evt
- Origin event
- Returns:
- Standard event
<static>
{boolean}
SweetDevRia.EventHelper.removeListener(element, type, handler, fn)
Remove an event handler.
- Parameters:
- {HtmlElement} element
- DOM object
- {String} type
- Event type (i.e. "mousedown")
- {function} handler
- Function to remove when event is detected
- {Function} fn
- the method the event invokes
- Returns:
- {boolean} true if the unbind was successful, false
<static>
SweetDevRia.EventHelper.runLoadListeners()
Run all the load events in the right order.
<static>
SweetDevRia.EventHelper.stopPropagation()
Stop event propagation.
- Parameters:
- {event} event.