mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-64194 block_myoverview: incorrect pagination
The pagination was found to be incorrect due to the all the items event not being triggered if the amount of courses the user has is equal to the amount set via pagination. The condition could not just be changed to `>=` as this would trigger the event when there were further pages to display. A check of `remainingCourses` was added to condition so if the amount of courses on the current loaded page is less than the pagination amount, or there are no remaining courses, the all items event is triggered and the pagination bar hidden correctly.
This commit is contained in:
parent
0920f35ed9
commit
e04b82d30d
2
blocks/myoverview/amd/build/view.min.js
vendored
2
blocks/myoverview/amd/build/view.min.js
vendored
File diff suppressed because one or more lines are too long
@ -499,7 +499,7 @@ function(
|
||||
}
|
||||
|
||||
// Set the last page to either the current or next page
|
||||
if (loadedPages[currentPage].courses.length < pageData.limit) {
|
||||
if (loadedPages[currentPage].courses.length < pageData.limit || !remainingCourses.length) {
|
||||
lastPage = currentPage;
|
||||
actions.allItemsLoaded(currentPage);
|
||||
} else if (loadedPages[currentPage + 1] != undefined
|
||||
|
Loading…
x
Reference in New Issue
Block a user