event.Manager

Event manager. Using an event manager, you can subscribe to and unsubscribe from events, as well as initiate the events themselves. The manager implements the possibility of building a hierarchy of event propagation using the method event.Manager.setParent.

Event propagation has three phases:

1. Direct subscribers get events.

2. Objects that are higher up in the hierarchy get events when they are relayed on the parent event manager.

3. Default action handlers get events via a type + 'defaultaction' service event; the default action is performed only if the event's "target" field matches the context for the event manager.

The manager also allows you to specify the priority when adding event handlers. When throwing events, the handlers will be called in order of decreasing priority.

Subscriptions with the same callback and context parameters but different priority settings are considered to be different. When removing subscriptions, you must specify the same priority as was set when it was added.