Skip to content
Snippets Groups Projects
Commit 425de039 authored by Alexis POYEN's avatar Alexis POYEN
Browse files

Fix : bug when changing filter

Did not actualize the zone when changing filter
parent 1c00b849
No related branches found
No related tags found
No related merge requests found
Pipeline #6567 passed
......@@ -64,6 +64,7 @@ class DetailedsResultsComponent {
document.getElementById(
"select-areas"
).value = this.parent.areaDisplayed.ID;
this.displayZoneResults(this.parent.areaDisplayed);
} else this.displayZoneResults(this.parent.parent.results.areasResults[0]);
}
......@@ -84,6 +85,7 @@ class DetailedsResultsComponent {
document.getElementById(
"select-sections"
).value = this.parent.sectionDisplayed.ID;
this.displayZoneResults(this.parent.sectionDisplayed);
} else {
this.displayZoneResults(
this.parent.parent.results.areasResults[0].Sections[0]
......
......@@ -118,7 +118,16 @@ class ResultZoneComponent {
for (var i = 0; i < radioButtons.length; i++) {
radioButtons[i].addEventListener("click", async (e) => {
await this.parent.calculateResults();
this.displayResults();
if (this.areaDisplayed !== undefined) {
this.areaDisplayed = resultHandler.parent.results.areasResults.find(
(areaFind) => areaFind.ID == this.areaDisplayed.ID
);
if (this.sectionDisplayed !== undefined)
this.sectionDisplayed = this.areaDisplayed.Sections.find(
(sectionFind) => sectionFind.ID == this.sectionDisplayed.ID
);
}
await this.displayResults();
});
}
}
......
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