'core/custom_interaction_events',
'core/notification',
'core/templates',
- 'core_course/events'
++ 'core_course/events',
+ 'block_myoverview/selectors'
],
function(
$,
CustomEvents,
Notification,
Templates,
- CourseEvents
++ CourseEvents,
+ Selectors
) {
var SELECTORS = {
pagesData.forEach(function(pageData) {
var currentPage = pageData.pageNumber;
- var pageNumber = pageData.pageNumber - 1;
+ var limit = pageData.limit;
+
+ if (lastPage == currentPage) {
+ // If we are on the last page and have it's data then load it from cache
+ actions.allItemsLoaded(lastPage);
+ promises.push(renderCourses(root, loadedPages[currentPage]));
- return true;
++ return;
+ }
+
+ // Get 2 pages worth of data as we will need it for the hidden functionality.
+ if (loadedPages[currentPage + 1] == undefined) {
+ if (loadedPages[currentPage] == undefined) {
+ limit *= 2;
+ }
+ }
var pagePromise = getMyCourses(
filters,
$string['aria:sortingdropdown'] = 'Sorting dropdown';
$string['card'] = 'Card';
$string['cards'] = 'Cards';
+ $string['courseprogress'] = 'Course progress:';
$string['complete'] = 'Complete';
-$string['favourite'] = 'Starred course';
$string['favourites'] = 'Starred';
$string['future'] = 'Future';
$string['inprogress'] = 'In progress';
<div class="card-deck dashboard-card-deck" role="list">
{{#courses}}
- <div class="card dashboard-card" role="listitem">
+ <div class="card dashboard-card" role="listitem"
+ data-region="course-content"
+ data-course-id="{{{id}}}">
<a href="{{viewurl}}" tabindex="-1">
<div class="card-img dashboard-card-img" style='background-image: url("{{{courseimage}}}");'>
- <span class="sr-only">{{#str}}aria:courseimage, block_myoverview{{/str}}</span>
- {{> block_myoverview/favourite-icon }}
+ <span class="sr-only">{{#str}}aria:courseimage, core_course{{/str}}</span>
+ {{> core_course/favouriteicon }}
</div>
</a>
<div class="card-body pr-1 course-info-container" id="course-info-container-{{id}}">