MOBILE-3068 ionic: Close modals before going back

main
Pau Ferrer Ocaña 2019-08-26 10:12:48 +02:00
parent aafab95e8e
commit f3debfab1f
3 changed files with 19 additions and 1 deletions

View File

@ -65,6 +65,19 @@ export class MoodleMobileApp implements OnInit {
app.setElementClass('platform-windows', true);
}
}
// Register back button action to allow closing modals before anything else.
this.appProvider.registerBackButtonAction(() => {
// Following function is hidden in Ionic Code, however there's no solution for that.
const portal = app._getActivePortal();
if (portal) {
portal.pop();
return true;
}
return false;
}, 2000);
});
}

View File

@ -1012,6 +1012,11 @@ ion-app.app-root {
ion-alert .alert-checkbox-button .alert-checkbox-label {
white-space: normal;
}
ion-backdrop {
transition: opacity 100ms ease-in-out;
opacity: .1;
}
}
@each $color-name, $color-base, $color-contrast in get-colors($colors) {

View File

@ -178,7 +178,7 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy {
showContextMenu(event: MouseEvent): void {
if (!this.expanded) {
const popover = this.popoverCtrl.create(CoreContextMenuPopoverComponent,
{ title: this.title, items: this.items, id: this.uniqueId });
{ title: this.title, items: this.items, id: this.uniqueId, showBackdrop: true });
popover.onDidDismiss(() => {
this.expanded = false;