set student progression pagination container

test plan:
 - have a course with more than 50 students and only one module
 - go to /courses/X/modules/progressions in a full-screen
   browser window (the key here is that the page needs to fit
   in the window vertically so there is no scrollbar attached
   to the window)
 - scroll down through the list of students on the right side
 - the second page of students should load
 - also, test viewing this page as a student (you should still
   see your own progression on the left)

I suggest testing in Firefox because Chrome sends a Window
scroll event even when there is nowhere to scroll

fixes CNVS-14255

Change-Id: Ib12b44e9d047b35193913be5e91e1f9dee74fa43
Reviewed-on: https://gerrit.instructure.com/38749
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
This commit is contained in:
Jeremy Stanley 2014-08-05 10:18:34 -06:00
parent 2ba6efd19e
commit 6a5defd99f
2 changed files with 17 additions and 2 deletions

View File

@ -17,15 +17,20 @@ require [
per_page: 50
enrollment_type: 'student'
students.fetch()
indexView = new PaginatedCollectionView
collection: students
itemView: ProgressionStudentView
template: progressionsIndexTemplate
modules_url: ENV.MODULES_URL
autoFetch: true
unless ENV.RESTRICTED_LIST
# attach the view's scroll container once it's populated
students.fetch success: ->
indexView.resetScrollContainer(indexView.$el.find('#progression_students .collectionViewItems'))
indexView.render()
if ENV.RESTRICTED_LIST && ENV.VISIBLE_STUDENTS.length == 1
indexView.$el.find('#progression_students').hide()
indexView.$el.appendTo($('#content'))

View File

@ -55,6 +55,16 @@ define [
super
@initScrollContainer()
##
# Set the scroll container after the view has been created.
# Useful if the view is created before the container is rendered.
resetScrollContainer: (container) =>
@detachScroll()
@scrollContainer = container
@initScrollContainer()
@attachScroll()
##
# Extends parent to detach scroll container event
#