Skip to content
Snippets Groups Projects
Commit 2362bd28 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: handling of modal open

parent 634d6620
No related branches found
No related tags found
2 merge requests!31Recette,!12Topic search
......@@ -63,7 +63,7 @@
<div class="arrow"></div>
</button>
</div>
<div *ngIf="modalTypeOpened != null">
<div *ngIf="isOpenModal">
<app-modal-filter
[modalType]="modalTypeOpened"
[categories]="categories"
......
......@@ -121,20 +121,18 @@ export class SearchComponent implements OnInit {
// Open the modal and display the list according to the right filter button
public openModal(modalType: TypeModal): void {
this.categories = [];
if (this.modalTypeOpened !== modalType) {
if (!this.isOpenModal) {
this.modalTypeOpened = modalType;
this.fakeData(modalType);
this.isOpenModal = true;
} else {
this.isOpenModal = false;
}
} else {
this.modalTypeOpened = null;
// if modal already closed, reset type
if (this.modalTypeOpened === modalType && !this.isOpenModal) {
this.modalTypeOpened = undefined;
} else if (!this.isOpenModal && this.modalTypeOpened !== modalType) {
this.modalTypeOpened = modalType;
this.fakeData(modalType);
this.isOpenModal = true;
}
}
public closeModal(): void {
this.modalTypeOpened = null;
this.isOpenModal = false;
}
private fromStringToIdExcel(categ: string): string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment