Merge pull request #1391 from albertgasset/MOBILE-2452

MOBILE-2452 course: Scroll back after completing an activity
main
Juan Leyva 2018-07-04 12:48:23 +02:00 committed by GitHub
commit 53b0233e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -17,7 +17,7 @@
<core-context-menu-item [priority]="1800" [content]="'core.course.coursesummary' | translate" (action)="openCourseSummary()" iconAction="fa-graduation-cap"></core-context-menu-item> <core-context-menu-item [priority]="1800" [content]="'core.course.coursesummary' | translate" (action)="openCourseSummary()" iconAction="fa-graduation-cap"></core-context-menu-item>
</core-context-menu> </core-context-menu>
</core-navbar-buttons> </core-navbar-buttons>
<ion-content> <ion-content #courseSectionContent>
<ion-refresher [enabled]="dataLoaded && displayRefresher" (ionRefresh)="doRefresh($event)"> <ion-refresher [enabled]="dataLoaded && displayRefresher" (ionRefresh)="doRefresh($event)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content> <ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher> </ion-refresher>

View File

@ -37,7 +37,7 @@ import { CoreTabsComponent } from '@components/tabs/tabs';
templateUrl: 'section.html', templateUrl: 'section.html',
}) })
export class CoreCourseSectionPage implements OnDestroy { export class CoreCourseSectionPage implements OnDestroy {
@ViewChild(Content) content: Content; @ViewChild('courseSectionContent') content: Content;
@ViewChild(CoreCourseFormatComponent) formatComponent: CoreCourseFormatComponent; @ViewChild(CoreCourseFormatComponent) formatComponent: CoreCourseFormatComponent;
@ViewChild(CoreTabsComponent) tabsComponent: CoreTabsComponent; @ViewChild(CoreTabsComponent) tabsComponent: CoreTabsComponent;
@ -304,7 +304,11 @@ export class CoreCourseSectionPage implements OnDestroy {
this.loadData().finally(() => { this.loadData().finally(() => {
this.dataLoaded = true; this.dataLoaded = true;
this.content.scrollTo(scrollLeft, scrollTop);
// Wait for new content height to be calculated and scroll without animation.
setTimeout(() => {
this.content.scrollTo(scrollLeft, scrollTop, 0);
});
}); });
} }