Fix course progress tab select

This commit is contained in:
Scott Erickson 2016-05-26 15:01:16 -07:00
parent dfcbbb7c9c
commit 7d1d1500d9

View file

@ -41,6 +41,7 @@ module.exports = class TeacherClassView extends RootView
'click .select-all': 'onClickSelectAll'
'click .student-checkbox': 'onClickStudentCheckbox'
'keyup #student-search': 'onKeyPressStudentSearch'
'change .course-select, .bulk-course-select': 'onChangeCourseSelect'
getInitialState: ->
{
@ -149,6 +150,8 @@ module.exports = class TeacherClassView extends RootView
@listenTo @students, 'sort', ->
@state.set students: @students
@render()
@listenTo @, 'course-select:change', ({ selectedCourse }) ->
@state.set selectedCourse: selectedCourse
setCourseMembers: =>
for course in @courses.models
@ -273,6 +276,10 @@ module.exports = class TeacherClassView extends RootView
onKeyPressStudentSearch: (e) ->
@state.set('searchTerm', $(e.target).val())
onChangeCourseSelect: (e) ->
console.log '??'
@trigger 'course-select:change', { selectedCourse: @courses.get($(e.currentTarget).val()) }
getSelectedStudentIDs: ->
@$('.student-row .checkbox-flat input:checked').map (index, checkbox) ->
$(checkbox).data('student-id')