Merge pull request #2024 from dpalou/MOBILE-3044

MOBILE-3044 lesson: Fix PTR in Reports tab
main
Juan Leyva 2019-07-31 12:59:21 +02:00 committed by GitHub
commit 05bdd26a53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -16,7 +16,7 @@
<core-tabs [hideUntil]="loaded" [selectedIndex]="selectedTab"> <core-tabs [hideUntil]="loaded" [selectedIndex]="selectedTab">
<!-- Index/Preview tab. --> <!-- Index/Preview tab. -->
<core-tab [title]="'addon.mod_lesson.preview' | translate"> <core-tab [title]="'addon.mod_lesson.preview' | translate" (ionSelect)="indexSelected()">
<ng-template> <ng-template>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description> <core-course-module-description [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description>

View File

@ -384,10 +384,19 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo
}); });
} }
/**
* First tab selected.
*/
indexSelected(): void {
this.selectedTab = 0;
}
/** /**
* Reports tab selected. * Reports tab selected.
*/ */
reportsSelected(): void { reportsSelected(): void {
this.selectedTab = 1;
if (!this.groupInfo) { if (!this.groupInfo) {
this.fetchReportData().catch((error) => { this.fetchReportData().catch((error) => {
this.domUtils.showErrorModalDefault(error, 'Error getting report.'); this.domUtils.showErrorModalDefault(error, 'Error getting report.');