Skip to content

Commit

Permalink
Add onActive method in ComponentView which executes on active event
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Jul 20, 2018
1 parent 52a4832 commit 9677d9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dom_components/view/ComponentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = Backbone.View.extend({
this.listenTo(model, 'change:script', this.render);
this.listenTo(model, 'change:content', this.updateContent);
this.listenTo(model, 'change', this.handleChange);
this.listenTo(model, 'active', this.onActive);
this.listenTo(classes, 'add remove change', this.updateClasses);
$el.data('model', model);
$el.data('collection', model.get('components'));
Expand All @@ -45,6 +46,11 @@ module.exports = Backbone.View.extend({
*/
init() {},

/**
* Callback executed when the `active` event is triggered on component
*/
onActive() {},

/**
* Handle any property change
* @private
Expand Down

0 comments on commit 9677d9f

Please sign in to comment.