Home

# Class goog.jsaction.EventContract

Instantiates EventContract, the object responsible for jsaction-related event handling and queuing.

Instance Method Summary
| `addContainer(!Element containerElem)` Adds a container element. Container elements is where EventContract registeres actual DOM event handlers. Adding a container element will enable jsaction-handling for its whole subtree.
| `addEvent(string eventType)` Adds an event type to listen for.
| `getQueue() ⇒ !Array`
| `handleEvent_(!Event e, !Element containerElem)` Handles a browser event. Walks up the DOM tree starting at the target element of the event until it finds an eligible action for the event or reaches the container element. If an action is found, the event is handed to the dispatcher to invoke an associated action handler (TODO, coming real soon).
| `setDispatcher(?goog.jsaction.Dispatcher dispatcher)` Sets the dispatcher.

Static Method Summary
| `createEventHandler_(!goog.jsaction.EventContract contract, !Element container) ⇒ function (Event): ?` Creates the event handler function to be used for a container element.
| `getAction_(!Element elem, string eventType) ⇒ ?string` Gets the action for the given element and event type.
| `parseJsActionAttribute_(!Element elem) ⇒ !Object` Parses the jsaction-attribute on the given element and returns a map from event type to action.