MOBILE-3833 user-tours: Fix close user tours in iOS 12

main
Dani Palou 2022-04-21 12:26:11 +02:00
parent 7c8d372ec2
commit c3c8594199
2 changed files with 10 additions and 1 deletions

View File

@ -353,7 +353,6 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon
* @return Promise resolved when done.
*/
protected async showLoadingAndRefresh(sync = false, invalidateData = true): Promise<void> {
// Save scroll position to restore it once done.
this.updatingData = true;
this.changeDetectorRef.detectChanges();

View File

@ -183,6 +183,11 @@ export class CoreUserToursUserTourComponent implements AfterViewInit, OnDestroy
* Play animation to show that the User Tour has started.
*/
private async playEnterAnimation(): Promise<void> {
if (!('animate' in this.element)) {
// Not supported, don't animate.
return;
}
const animations = [
this.element.animate({ opacity: ['0', '1'] }, { duration: ANIMATION_DURATION }),
this.wrapperElement.value?.animate(
@ -198,6 +203,11 @@ export class CoreUserToursUserTourComponent implements AfterViewInit, OnDestroy
* Play animation to show that the User Tour has endd.
*/
private async playLeaveAnimation(): Promise<void> {
if (!('animate' in this.element)) {
// Not supported, don't animate.
return;
}
const animations = [
this.element.animate({ opacity: ['1', '0'] }, { duration: ANIMATION_DURATION }),
this.wrapperElement.value?.animate(