Przeglądaj źródła

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 5 lat temu
rodzic
commit
0078af56eb
1 zmienionych plików z 4 dodań i 0 usunięć
  1. +4
    -0
      macrovision.js

+ 4
- 0
macrovision.js Wyświetl plik

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



Ładowanie…
Anuluj
Zapisz