Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/1888 #1911

Merged
merged 14 commits into from
Jan 10, 2018
6 changes: 6 additions & 0 deletions src/core/js/views/adaptView.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ define([
this.listenTo(Adapt, 'remove', this.remove);
this.listenTo(this.model, 'change:_isVisible', this.toggleVisibility);
this.listenTo(this.model, 'change:_isHidden', this.toggleHidden);
this.listenTo(this.model, 'change:_isComplete', this.onIsCompleteChange);
this.model.set('_globals', Adapt.course.get('_globals'));
this.model.set('_isReady', false);
this._isRemoved = false;
Expand Down Expand Up @@ -171,6 +172,11 @@ define([
return this.$el.removeClass('display-none');
}
this.$el.addClass('display-none');
},

onIsCompleteChange:function(model){
var isComplete=model.get('_isComplete');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the second argument passed to the function rather than a new variable please?

this.$el.toggleClass('completed', isComplete);
}
});

Expand Down
3 changes: 2 additions & 1 deletion src/core/js/views/articleView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ define([
" " + this.setVisibility() +
" " + this.setHidden() +
" nth-child-" +
this.model.get("_nthChild");
this.model.get("_nthChild") +
" " + (this.model.get('_isComplete') ? 'completed' : '');
}

}, {
Expand Down
3 changes: 2 additions & 1 deletion src/core/js/views/blockView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ define([
" " + this.setVisibility() +
" " + this.setHidden() +
" nth-child-" +
this.model.get("_nthChild");
this.model.get("_nthChild") +
" " + (this.model.get('_isComplete') ? 'completed' : '');
}

}, {
Expand Down
3 changes: 2 additions & 1 deletion src/core/js/views/componentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ define([
" " + this.setVisibility() +
" " + this.setHidden() +
" component-" + this.model.get('_layout') +
" nth-child-" + this.model.get("_nthChild");
" nth-child-" + this.model.get("_nthChild") +
" " + (this.model.get('_isComplete') ? 'completed' : '');
},

initialize: function(){
Expand Down
5 changes: 3 additions & 2 deletions src/core/js/views/pageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ define([
return "page " +
this.model.get('_id') +
" " + this.model.get('_classes') +
" " + this.setVisibility();
" " + this.setVisibility() +
" " + (this.model.get('_isComplete') ? 'completed' : '');
},

preRender: function() {
Expand Down Expand Up @@ -70,4 +71,4 @@ define([

return PageView;

});
});
3 changes: 2 additions & 1 deletion src/core/js/views/questionView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ define([
+ " " + this.model.get('_classes')
+ " " + this.setVisibility()
+ " component-" + this.model.get('_layout')
+ " nth-child-" + this.model.get("_nthChild");
+ " nth-child-" + this.model.get("_nthChild")
+ (this.model.get('_isComplete') ? ' completed' : '');
},

//////
Expand Down