Fork me on GitHub
Show:

Events

Extends Backbone.Events
Defined in: ../src/events.js:2

Summary

An events manager, based on Backbone.Events.

Constructor

aeris.util.aeris.Events

Defined in ../src/events.js:2

Syntax

aeris.util.aeris.Events

()

Summary

Item Index

Methods

Methods

off

Defined in ../src/events.js:58

Syntax

off

()

on

Defined in ../src/events.js:37

Syntax

on

()

Summary

Bind an event handler to the object. See Backbone.Events#on

proxyEvents

Defined in ../src/events.js:80

Syntax

proxyEvents

(
  • obj
  • =}
  • opt_ctx
)
protected

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):Object

    opt_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