Events
Summary
An events manager, based on Backbone.Events.
Constructor
aeris.util.aeris.Events
Syntax
aeris.util.aeris.Events
()
Summary
Item Index
Methods
- off
- on
- proxyEvents
- publish static
- removeProxy
- subscribe static
- unsubscribe static
Methods
on
Syntax
on
()
Summary
Bind an event handler to the object. See Backbone.Events#on
proxyEvents
Syntax
proxyEvents
-
obj
-
=}
-
opt_ctx
Summary
Proxies all events from another {aeris.Event} object. In other words, all the events that you trigger, I'm gonna trigger too.
Passes along the original object as the first argument when triggering proxied events.
Parameters:
-
obj
Events=The object to proxy.
-
=}
Function(string, Array):Objectopt_callback A callback function to customize the proxied event. Should return on object with 'topic' and 'args' properties.
Example: parent.proxy(child, function(topic, args) { return { topic: 'child:' + topic, args: [child].concat(args) } }); ...would trigger all child events, with a topic prepended with 'child:', and with the child object inserted as the first argument.
-
opt_ctx
Object=A context in which to call the opt_callback function. Defaults to this.
publish
Syntax
publish
()
static
Summary
Publish a global event Same signature as {aeris.Events}#trigger
removeProxy
Syntax
removeProxy
()
protected
Summary
End any proxies that have been wrapped around this {Events} object.
subscribe
Syntax
subscribe
()
static
Summary
Subscribe to a global event Same signature as {aeris.Events}#on
unsubscribe
Syntax
unsubscribe
()
static
Summary
Unsubscribe from a global event Same signature as {aeris.Events}#off