Core Events

Daryl Hedley edited this page May 14, 2014 · 1 revision
Clone this wiki locally

Overview

Origin has been built with a module approach and to keep modules separate Origin uses events to pass information between modules and notify them of changes.

Backbone built-in events

Backbone automatically triggers an event when an attribute changes. Please look at the Backbonejs.org website for more information on Events.

Origin built-in events

Origin also allows modules to plugin into events through events triggered by core views, models and collections. These events can be listened to by using the following syntax:

Origin.on('app:dataReady', function() {
    // Triggered when everything is loaded
});

Below is a list of all the core events:

Core Events
  • ('app:dataReady') - Triggered when data is ready just before Origin is initialized.
  • ('origin:initialize') - Triggered just before Backbone.history.start() is fired.