Merge pull request #4835 from tsiegleauq/even-smarter-back-button

Prevent double mobile back buttons
This commit is contained in:
Emanuel Schütze 2019-07-10 09:08:04 +02:00 committed by GitHub
commit 6295240cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -7,12 +7,12 @@
<mat-toolbar color="primary" [ngClass]="multiSelectMode ? 'multi-select' : ''" class="sticky-toolbar"> <mat-toolbar color="primary" [ngClass]="multiSelectMode ? 'multi-select' : ''" class="sticky-toolbar">
<div class="toolbar-left"> <div class="toolbar-left">
<!-- Nav menu --> <!-- Nav menu -->
<button mat-icon-button *ngIf="vp.isMobile && !showBackButton" (click)="clickHamburgerMenu()"> <button mat-icon-button *ngIf="vp.isMobile && !showBackButton && !editMode" (click)="clickHamburgerMenu()">
<mat-icon>menu</mat-icon> <mat-icon>menu</mat-icon>
</button> </button>
<!-- Exit / Back button --> <!-- Exit / Back button -->
<button mat-icon-button *ngIf="showBackButton" (click)="onBackButton()"> <button mat-icon-button *ngIf="showBackButton && !editMode" (click)="onBackButton()">
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
</button> </button>

View File

@ -112,7 +112,7 @@ export class HeadBarComponent {
public saveEvent = new EventEmitter<boolean>(); public saveEvent = new EventEmitter<boolean>();
public get showBackButton(): boolean { public get showBackButton(): boolean {
return !this.nav && !this.editMode && !this.multiSelectMode && this.routingState.isSafePrevUrl; return !this.nav && !this.multiSelectMode && (this.routingState.isSafePrevUrl || !this.goBack);
} }
/** /**