Add cancel to sort dialog and fix backdrop close

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 46d823720c
commit b989e02bee

@ -114,10 +114,13 @@ export class FileSearchComponent implements AfterViewChecked {
data: { data: {
sortEntries, sortEntries,
}, },
disableClose: true,
}); });
openedDialog.afterClosed().subscribe(async (sortExpression) => { openedDialog.afterClosed().subscribe(async (sortExpression) => {
if (sortExpression) {
this.sortExpression = sortExpression; this.sortExpression = sortExpression;
await this.searchForFiles(); await this.searchForFiles();
}
}); });
} }
} }

@ -34,4 +34,5 @@
</div> </div>
<div class="dialog-actions" mat-dialog-actions> <div class="dialog-actions" mat-dialog-actions>
<button mat-flat-button color="primary" (click)="confirmSort()">Sort</button> <button mat-flat-button color="primary" (click)="confirmSort()">Sort</button>
<button mat-stroked-button color="accent" (click)="cancelSort()">Cancel</button>
</div> </div>

@ -18,7 +18,10 @@ mat-form-field, .filler {
} }
.dialog-actions { .dialog-actions {
align-items: center; display: flex;
text-align: center; flex-direction: row-reverse;
width: 100%; width: 100%;
button {
margin-left: 1em;
}
} }

@ -28,4 +28,8 @@ export class FilterDialogComponent {
public confirmSort(): void { public confirmSort(): void {
this.dialogRef.close(this.sortEntries); this.dialogRef.close(this.sortEntries);
} }
public cancelSort(): void {
this.dialogRef.close()
}
} }

Loading…
Cancel
Save