-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilterController.js
More file actions
27 lines (24 loc) · 858 Bytes
/
filterController.js
File metadata and controls
27 lines (24 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// filterController.js
/**
* Función para obtener la opción seleccionada del filtro.
* @returns {string} - La opción seleccionada.
*/
export function getSelectedFilterOption() {
const selectElement = document.getElementById('choise');
return selectElement.options[selectElement.selectedIndex].text;
}
/**
* Función para actualizar la etiqueta statusChoise con el filtro seleccionado.
* @param {string} filterOption - La opción de filtro seleccionada.
*/
export function updateStatusChoise(filterOption) {
const statusChoiseElement = document.getElementById('statusChoise');
statusChoiseElement.textContent = filterOption;
}
/**
* Función para manejar el evento de clic en el botón Apply.
*/
export function handleApplyClick() {
const selectedOption = getSelectedFilterOption();
updateStatusChoise(selectedOption);
}