Sfoglia il codice sorgente

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 6 anni fa
parent
commit
0078af56eb
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. +4
    -0
      macrovision.js

+ 4
- 0
macrovision.js Vedi File

@@ -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;
}
});



Loading…
Annulla
Salva