- Basic overview of all the assignments needed to be solved in a lesson - Clicking on a link will jump to the correct page with the assignment - Lesson completed also updates lesson overview immediately
25 lines
544 B
JavaScript
25 lines
544 B
JavaScript
define([
|
|
'backbone'],
|
|
function(
|
|
Backbone) {
|
|
return Backbone.View.extend({
|
|
tagName: 'li',
|
|
template: _.template($('#assignmentTemplate').html() ),
|
|
|
|
events: {
|
|
"click a": "clicked"
|
|
},
|
|
|
|
clicked: function(e){
|
|
e.preventDefault();
|
|
var id = $(e.currentTarget).data("id");
|
|
Backbone.trigger('assignment:navTo',{'assignment': id});
|
|
},
|
|
|
|
render: function() {
|
|
this.$el.html(this.template(this.model.toJSON()));
|
|
return this;
|
|
}
|
|
});
|
|
});
|