diff --git a/src/core/features/course/components/course-index/course-index.html b/src/core/features/course/components/course-index/course-index.html index 8de92a89b..7fca7f10e 100644 --- a/src/core/features/course/components/course-index/course-index.html +++ b/src/core/features/course/components/course-index/course-index.html @@ -11,74 +11,79 @@ - - - - -

- - -

-
-
- - - - - + + + +

- {{highlighted}} - - -
-
- - - - - - - - - - - -

- - -

-
- -
+ + + + + + +

+ + +

+
+ {{highlighted}} + + + +
+
+ + + + + + + + + + + +

+ + +

+
+ +
+
- -
+
+
-
-
+ +
diff --git a/src/core/features/course/components/course-index/course-index.ts b/src/core/features/course/components/course-index/course-index.ts index f2a66fdde..3e9ee1499 100644 --- a/src/core/features/course/components/course-index/course-index.ts +++ b/src/core/features/course/components/course-index/course-index.ts @@ -21,6 +21,7 @@ import { import { CoreCourseHelper, CoreCourseSection } from '@features/course/services/course-helper'; import { CoreCourseFormatDelegate } from '@features/course/services/format-delegate'; import { CoreCourseAnyCourseData } from '@features/courses/services/courses'; +import { CoreUtils } from '@services/utils/utils'; import { ModalController } from '@singletons'; import { CoreDom } from '@singletons/dom'; @@ -41,6 +42,7 @@ export class CoreCourseCourseIndexComponent implements OnInit { allSectionId = CoreCourseProvider.ALL_SECTIONS_ID; highlighted?: string; sectionsToRender: CourseIndexSection[] = []; + loaded = false; constructor( protected elementRef: ElementRef, @@ -109,6 +111,13 @@ export class CoreCourseCourseIndexComponent implements OnInit { this.highlighted = CoreCourseFormatDelegate.getSectionHightlightedName(this.course); + // Wait a bit to render the data, otherwise the modal takes a while to appear in big courses or slow devices. + await CoreUtils.wait(400); + + this.loaded = true; + + await CoreUtils.nextTick(); + CoreDom.scrollToElement( this.elementRef.nativeElement, '.item.item-current',