refactoring
This commit is contained in:
@@ -11,5 +11,9 @@ class UIUtils {
|
||||
chartViewElement: chartViewElement,
|
||||
canvas: chartViewElement.querySelector(".canvas")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static getSelectedOption(selectElement) {
|
||||
return selectElement.options[selectElement.selectedIndex];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
});
|
||||
|
||||
function onKreisOptionSelected(kreisSelect, intensiveCareCapacitiesChartView, freeBedsChartView) {
|
||||
const selectedOption = getSelectedOption(kreisSelect);
|
||||
const selectedOption = UIUtils.getSelectedOption(kreisSelect);
|
||||
displayIntensiveCareCapacitiesChart(
|
||||
{
|
||||
intensiveCareCapacitiesChartView: intensiveCareCapacitiesChartView,
|
||||
@@ -46,10 +46,6 @@
|
||||
freeBedsChartView.displayChart({ data: json.data, title: selectedOption.text });
|
||||
});
|
||||
}
|
||||
|
||||
function getSelectedOption(select) {
|
||||
return select.options[select.selectedIndex];
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user