Skip to content

Commit

Permalink
Fixed multiple call on language change. (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
NayanKhedkar authored and moloko committed Mar 11, 2019
1 parent a81c4b1 commit dcd8f58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/adapt-contrib-pageLevelProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ define([
var PageLevelProgress = Backbone.Controller.extend({

initialize: function() {
this.listenTo(Adapt, 'app:dataReady', this.onDataReady);
Adapt.on({
'app:dataReady': this.onDataReady.bind(this),
'app:languageChanged': function() {
// Remove events created by setUpEventListeners
this.stopListening();
}.bind(this)
});
},

getCourseConfig: function() {
Expand Down

0 comments on commit dcd8f58

Please sign in to comment.