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

fix: trigger pop-up modal

parent f3ff70b9
No related branches found
No related tags found
2 merge requests!31Recette,!12Topic search
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
type="button" type="button"
[disabled]="modalTypeOpened === TypeModal[2]" [disabled]="modalTypeOpened === TypeModal[2]"
[ngClass]="{ selected: modalTypeOpened === TypeModal[2] }" [ngClass]="{ selected: modalTypeOpened === TypeModal[2] }"
(click)="modalTypeOpened === TypeModal[2] ? test() : openModal(TypeModal[2])" (click)="openModal(TypeModal[2])"
fxLayout="row" fxLayout="row"
fxLayoutAlign="space-between center" fxLayoutAlign="space-between center"
> >
......
...@@ -26,7 +26,8 @@ export class SearchComponent implements OnInit { ...@@ -26,7 +26,8 @@ export class SearchComponent implements OnInit {
public searchForm: FormGroup; public searchForm: FormGroup;
// Modal variable // Modal variable
public categories: Category[]; public categories: Category[];
public modalTypeOpened: string; public modalTypeOpened: string; // todo: utiliser enum
public isOpenModal = false;
// Checkbox variable // Checkbox variable
public checkedModulesFilter: Module[]; public checkedModulesFilter: Module[];
...@@ -83,17 +84,20 @@ export class SearchComponent implements OnInit { ...@@ -83,17 +84,20 @@ export class SearchComponent implements OnInit {
public openModal(option: string): void { public openModal(option: string): void {
console.log(this.modalTypeOpened); console.log(this.modalTypeOpened);
console.log(option); console.log(option);
console.log(this.isOpenModal);
this.categories = []; this.categories = [];
if (this.modalTypeOpened !== option) { if (this.modalTypeOpened !== option) {
this.modalTypeOpened = option; if (!this.isOpenModal) {
this.fakeData(option); this.modalTypeOpened = option;
this.fakeData(option);
this.isOpenModal = true;
} else {
this.isOpenModal = false;
}
} else { } else {
this.modalTypeOpened = null; this.modalTypeOpened = null;
} }
} }
test() {
console.log('test');
}
public closeModal(): void { public closeModal(): void {
this.modalTypeOpened = null; this.modalTypeOpened = null;
} }
......
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