setting searchParams when selecting symptom or vaccine

This commit is contained in:
Frank Knoll
2024-07-14 01:11:04 +02:00
parent 214510bc33
commit 3f2c43aeb1
2 changed files with 12 additions and 3 deletions

View File

@@ -14324,7 +14324,6 @@
var a2a_config = a2a_config || {}; var a2a_config = a2a_config || {};
a2a_config.callbacks = a2a_config.callbacks || []; a2a_config.callbacks = a2a_config.callbacks || [];
a2a_config.callbacks.push({ a2a_config.callbacks.push({
// FK-TODO: use selected symptom and vaccine for url
share: _ => ({ url: window.location.href }), share: _ => ({ url: window.location.href }),
}); });
</script> </script>

View File

@@ -11,7 +11,12 @@ class PageInitializer {
{ {
selectElement: symptomSelectElement, selectElement: symptomSelectElement,
textOfOption2Select: selectSymptom, textOfOption2Select: selectSymptom,
onValueSelected: (id, text) => prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text), onValueSelected: (id, text) => {
prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text);
const url = new URL(window.location.href);
url.searchParams.set('symptom', text);
window.history.replaceState(null, "", url);
},
minimumInputLength: 0 minimumInputLength: 0
}); });
} }
@@ -22,7 +27,12 @@ class PageInitializer {
{ {
selectElement: vaccineSelectElement, selectElement: vaccineSelectElement,
textOfOption2Select: selectVaccine, textOfOption2Select: selectVaccine,
onValueSelected: (id, text) => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text), onValueSelected: (id, text) => {
prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text);
const url = new URL(window.location.href);
url.searchParams.set('vaccine', text);
window.history.replaceState(null, "", url);
},
minimumInputLength: 0 minimumInputLength: 0
}); });
} }