refactoring
This commit is contained in:
@@ -11,7 +11,7 @@ class PageInitializer {
|
|||||||
{
|
{
|
||||||
selectElement: symptomSelectElement,
|
selectElement: symptomSelectElement,
|
||||||
textOfOption2Select: searchParam.get(),
|
textOfOption2Select: searchParam.get(),
|
||||||
onValueSelected: (id, text) => {
|
onSelectOptionHavingValueAndText: (id, text) => {
|
||||||
prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text);
|
prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text);
|
||||||
searchParam.set(text);
|
searchParam.set(text);
|
||||||
},
|
},
|
||||||
@@ -25,7 +25,7 @@ class PageInitializer {
|
|||||||
{
|
{
|
||||||
selectElement: vaccineSelectElement,
|
selectElement: vaccineSelectElement,
|
||||||
textOfOption2Select: searchParam.get(),
|
textOfOption2Select: searchParam.get(),
|
||||||
onValueSelected: (id, text) => {
|
onSelectOptionHavingValueAndText: (id, text) => {
|
||||||
prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text);
|
prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text);
|
||||||
searchParam.set(text);
|
searchParam.set(text);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
class Select2 {
|
class Select2 {
|
||||||
|
|
||||||
// FK-TODO: rename onValueSelected to onSelectOptionHavingValueAndText
|
static initializeSelectElement(
|
||||||
static initializeSelectElement({ selectElement, textOfOption2Select, onValueSelected, minimumInputLength }) {
|
{
|
||||||
|
selectElement,
|
||||||
|
textOfOption2Select,
|
||||||
|
onSelectOptionHavingValueAndText,
|
||||||
|
minimumInputLength
|
||||||
|
}) {
|
||||||
selectElement.select2({ minimumInputLength: minimumInputLength });
|
selectElement.select2({ minimumInputLength: minimumInputLength });
|
||||||
selectElement.on(
|
selectElement.on(
|
||||||
'select2:select',
|
'select2:select',
|
||||||
function (event) {
|
function (event) {
|
||||||
const id = event.params.data.id;
|
const id = event.params.data.id;
|
||||||
const text = event.params.data.text;
|
const text = event.params.data.text;
|
||||||
onValueSelected(id, text);
|
onSelectOptionHavingValueAndText(id, text);
|
||||||
});
|
});
|
||||||
Select2.#selectOptionHavingText(selectElement, textOfOption2Select);
|
Select2.#selectOptionHavingText(selectElement, textOfOption2Select);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user