mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-78370 block_myoverview: Conditionally show "All" paging option
To minimise performance issues when displaying courses in Summary view, we need to conditionally show the "All" paging option. This commit will prevent the "All" paging option to be shown if there are more than 100 courses to be shown.
This commit is contained in:
parent
3056f6cdbd
commit
8c26445d8d
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
File diff suppressed because one or more lines are too long
@ -572,7 +572,11 @@ const itemsPerPageFunc = (pagingLimit, root) => {
|
||||
// Filter out all pagination options which are too large for the amount of courses user is enrolled in.
|
||||
const totalCourseCount = parseInt(root.find(SELECTORS.courseView.region).attr('data-totalcoursecount'), 10);
|
||||
return itemsPerPage.filter(pagingOption => {
|
||||
return pagingOption.value < totalCourseCount || pagingOption.value === 0;
|
||||
if (pagingOption.value === 0 && totalCourseCount > 100) {
|
||||
// To minimise performance issues, do not show the "All" option if the user is enrolled in more than 100 courses.
|
||||
return false;
|
||||
}
|
||||
return pagingOption.value < totalCourseCount;
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user