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: {
sortEntries,
},
disableClose: true,
});
openedDialog.afterClosed().subscribe(async (sortExpression) => {
this.sortExpression = sortExpression;
await this.searchForFiles();
if (sortExpression) {
this.sortExpression = sortExpression;
await this.searchForFiles();
}
});
}
}

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

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

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

Loading…
Cancel
Save