-
Notifications
You must be signed in to change notification settings - Fork 249
List of core events
Daryl Hedley edited this page Jan 7, 2014
·
12 revisions
Adapt has been built with a module approach and to keep modules separate Adapt uses events to pass information between modules and notify them of changes.
To listen to changes on any core model use the Adapt collections or course model. Backbone automatically triggers an event when an attribute changes.
// List of collections
Adapt.contentObjects
Adapt.articles
Adapt.blocks
Adapt.components
// Course model
Adapt.course
// How to listen
Adapt.articles.on('change:_isComplete', function(model) {
console.log('This article just changed complete status', model.get('_id'));
})
// If inside a view you can use listenTo
this.listenTo(Adapt.components, 'change', this.componentChangedAttribute);
// The model is passed into the componentChangedAttribute on the view
// Using 'change' listens to all changes on a model
- Framework in Five Minutes
- Setting up Your Development Environment
- Manual Installation of the Adapt Framework
- Adapt Command Line Interface
- Common Issues
- Reporting Bugs
- Requesting Features
- Creating Your First Course
- Styling Your Course
- Configuring Your Project with config.json
- Content starts with course.json
- Course Localisation
- Compiling, testing and deploying your Adapt course
- Core Plugins in the Adapt Learning Framework
- Converting a Course from Framework Version 1 to Version 2
- Contributing to the Adapt Project
- Git Flow
- Adapt API
- Adapt Command Line Interface
- Core Events
- Core Model Attributes
- Core Modules
- Web Security Audit
- Peer Code Review
- Plugins
- Developing Plugins
- Developer's Guide: Components
- Developer's Guide: Theme
- Making a theme editable
- Developer's Guide: Menu
- Registering a Plugin
- Semantic Version Numbers
- Core Model Attributes
- Adapt Command Line Interface
- Accessibility v3
- Adapt Framework Right to Left (RTL) Support