refactoring
This commit is contained in:
@@ -5,7 +5,7 @@ class PageInitializer {
|
||||
PageInitializer.#configureVaccine(vaccine);
|
||||
}
|
||||
|
||||
static #configureSymptom({ symptomSelectElement, selectSymptom, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
|
||||
static #configureSymptom({ symptomSelectElement, selectSymptom, onSymptomSelected, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
|
||||
const prrByVaccineTableView = new PrrByVaccineTableView(prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName);
|
||||
Select2.initializeSelectElement(
|
||||
{
|
||||
@@ -13,15 +13,13 @@ class PageInitializer {
|
||||
textOfOption2Select: selectSymptom,
|
||||
onValueSelected: (id, text) => {
|
||||
prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text);
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set('symptom', text);
|
||||
window.history.replaceState(null, "", url);
|
||||
onSymptomSelected(text);
|
||||
},
|
||||
minimumInputLength: 0
|
||||
});
|
||||
}
|
||||
|
||||
static #configureVaccine({ vaccineSelectElement, selectVaccine, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) {
|
||||
static #configureVaccine({ vaccineSelectElement, selectVaccine, onVaccineSelected, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) {
|
||||
const prrBySymptomTableView = new PrrBySymptomTableView(prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName);
|
||||
Select2.initializeSelectElement(
|
||||
{
|
||||
@@ -29,9 +27,7 @@ class PageInitializer {
|
||||
textOfOption2Select: selectVaccine,
|
||||
onValueSelected: (id, text) => {
|
||||
prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text);
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set('vaccine', text);
|
||||
window.history.replaceState(null, "", url);
|
||||
onVaccineSelected(text);
|
||||
},
|
||||
minimumInputLength: 0
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user