Skip to content

Commit

Permalink
Merge pull request #3798 from dpalou/MOBILE-4362
Browse files Browse the repository at this point in the history
Mobile 4362
  • Loading branch information
crazyserver authored Sep 28, 2023
2 parents 229f996 + e6a14ff commit 0ec36b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/addons/calendar/pages/event/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h1>
<p>{{ 'addon.calendar.type' + event.formattedType | translate }}</p>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="courseName" [href]="courseUrl" core-link capture="true">
<ion-item class="ion-text-wrap" *ngIf="courseName" [href]="courseUrl" core-link capture="true" detail="true">
<ion-label>
<p class="item-heading">{{ 'core.course' | translate}}</p>
<p>
Expand Down
8 changes: 5 additions & 3 deletions src/addons/coursecompletion/pages/report/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ <h2>{{ 'addon.coursecompletion.requiredcriteria' | translate }}</h2>
<core-format-text clean="true" [text]="criteria.details.requirement" [filter]="false"></core-format-text>
</p>
</ion-label>
<strong slot="end">{{ criteria.status }}</strong>
<strong slot="end" *ngIf="criteria.complete">{{ 'core.yes' | translate }}</strong>
<strong slot="end" *ngIf="!criteria.complete">{{ 'core.no' | translate }}</strong>
</ion-item>
<ion-item class="ion-hide-md-down ion-text-wrap">
<ion-label>
Expand All @@ -64,7 +65,7 @@ <h2>{{ 'addon.coursecompletion.requiredcriteria' | translate }}</h2>
</ion-row>
<ion-row *ngFor="let criteria of completion.completions">
<ion-col>
<core-format-text clean="true" [text]="criteria.title" [filter]="false"></core-format-text>
<core-format-text clean="true" [text]="criteria.details.type" [filter]="false"></core-format-text>
</ion-col>
<ion-col>
<core-format-text clean="true" [text]="criteria.details.criteria" [filter]="false"></core-format-text>
Expand All @@ -75,7 +76,8 @@ <h2>{{ 'addon.coursecompletion.requiredcriteria' | translate }}</h2>
<ion-col>
<core-format-text [text]="criteria.details.status" [filter]="false"></core-format-text>
</ion-col>
<ion-col>{{ criteria.status }}</ion-col>
<ion-col *ngIf="criteria.complete">{{ 'core.yes' | translate }}</ion-col>
<ion-col *ngIf="!criteria.complete">{{ 'core.no' | translate }}</ion-col>
<ion-col *ngIf="criteria.timecompleted">
{{ criteria.timecompleted * 1000 | coreFormatDate :'strftimedatetimeshort' }}
</ion-col>
Expand Down
9 changes: 9 additions & 0 deletions src/core/features/course/pages/contents/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon
* @returns Promise resolved when done.
*/
protected async showLoadingAndRefresh(sync = false, invalidateData = true): Promise<void> {
// Try to keep current scroll position.
const scrollElement = await CoreUtils.ignoreErrors(this.content?.getScrollElement());
const scrollTop = scrollElement?.scrollTop ?? -1;

this.updatingData = true;
this.changeDetectorRef.detectChanges();

Expand All @@ -371,6 +375,11 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon
} finally {
this.updatingData = false;
this.changeDetectorRef.detectChanges();

if (scrollTop > 0) {
await CoreUtils.nextTick();
this.content?.scrollToPoint(0, scrollTop, 0);
}
}
}

Expand Down

0 comments on commit 0ec36b4

Please sign in to comment.