Picture of Oliver Foster
Re: Blockslider _isComplete
by Oliver Foster - Wednesday, 8 January 2020, 11:35 AM
 

This is slightly tangential but possibly relevant.


There is another alternative to listening on a collection of block models or on an individual block model for the change:_isComplete event.

Example:

this.listenTo(Adapt.course, "bubble:change:_isComplete", this.onAnyModelComplete);


onAnyModelComplete: function(event) {

  // event.type === "bubble:change:_isComplete";

  // event.target === source adapt model;

  // event.value === _isComplete value true/false};

}

 

Both change:_isComplete and change:_isInteractionComplete bubble by default for all models which extend the AdaptModel.

References:


AdaptModel

ModelEvent

Bubbling Events

Bubbling Attachment

Bubbling Handlers