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 @@ ...@@ -63,7 +63,7 @@
<div class="arrow"></div> <div class="arrow"></div>
</button> </button>
</div> </div>
<div *ngIf="modalTypeOpened != null"> <div *ngIf="isOpenModal">
<app-modal-filter <app-modal-filter
[modalType]="modalTypeOpened" [modalType]="modalTypeOpened"
[categories]="categories" [categories]="categories"
......
...@@ -121,20 +121,18 @@ export class SearchComponent implements OnInit { ...@@ -121,20 +121,18 @@ export class SearchComponent implements OnInit {
// Open the modal and display the list according to the right filter button // Open the modal and display the list according to the right filter button
public openModal(modalType: TypeModal): void { public openModal(modalType: TypeModal): void {
this.categories = []; this.categories = [];
if (this.modalTypeOpened !== modalType) { // if modal already closed, reset type
if (!this.isOpenModal) { if (this.modalTypeOpened === modalType && !this.isOpenModal) {
this.modalTypeOpened = modalType; this.modalTypeOpened = undefined;
this.fakeData(modalType); } else if (!this.isOpenModal && this.modalTypeOpened !== modalType) {
this.isOpenModal = true; this.modalTypeOpened = modalType;
} else { this.fakeData(modalType);
this.isOpenModal = false; this.isOpenModal = true;
}
} else {
this.modalTypeOpened = null;
} }
} }
public closeModal(): void { public closeModal(): void {
this.modalTypeOpened = null; this.isOpenModal = false;
} }
private fromStringToIdExcel(categ: string): string { private fromStringToIdExcel(categ: string): string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment