Explorar el Código

Disable filter options in addition to filtering them

Otherwise, whilst the option doesn't appear in the dropdown list,
it will still be selectable via the keyboard, causing an error.
master
Fen Dweller hace 6 años
padre
commit
0078af56eb
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. +4
    -0
      macrovision.js

+ 4
- 0
macrovision.js Ver fichero

@@ -2704,9 +2704,11 @@ function recomputeFilters() {
document.querySelectorAll("#filter-" + filter.id + " > option").forEach(element => {
if (filterSets[filter.id].has(element.value) || filter.id == "none") {
element.classList.remove("filtered");
element.disabled = false;
found = true;
} else {
element.classList.add("filtered");
element.disabled = true;
}
});

@@ -2714,8 +2716,10 @@ function recomputeFilters() {
const filterOption = document.querySelector("#filter-picker > option[value='" + filter.id + "']");
if (found) {
filterOption.classList.remove("filtered");
filterOption.disabled = false;
} else {
filterOption.classList.add("filtered");
filterOption.disabled = true;
}
});



Cargando…
Cancelar
Guardar