chore: remove dead sort_filter code
This commit is contained in:
@@ -4,7 +4,6 @@ import "./htmx";
|
||||
import "./dropdown";
|
||||
import "./anime";
|
||||
import "./search";
|
||||
import "./sort_filter";
|
||||
import "./dedupe";
|
||||
import "./watchlist";
|
||||
import "./top_pick_carousel";
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import { onReady } from "./utils";
|
||||
|
||||
const initSortFilter = (): void => {
|
||||
const sortSelect = document.getElementById("sort-select") as HTMLSelectElement | null;
|
||||
const orderSelect = document.getElementById("order-select") as HTMLSelectElement | null;
|
||||
|
||||
const submitForm = (): void => {
|
||||
const form = document.getElementById("sort-form") as HTMLFormElement | null;
|
||||
if (form) form.submit();
|
||||
};
|
||||
|
||||
// sync select values to hidden inputs, then submit form
|
||||
sortSelect?.addEventListener("change", () => {
|
||||
const input = document.getElementById("sort-input") as HTMLInputElement | null;
|
||||
if (input) input.value = sortSelect.value;
|
||||
submitForm();
|
||||
});
|
||||
|
||||
orderSelect?.addEventListener("change", () => {
|
||||
const input = document.getElementById("order-input") as HTMLInputElement | null;
|
||||
if (input) input.value = orderSelect.value;
|
||||
submitForm();
|
||||
});
|
||||
};
|
||||
|
||||
onReady(initSortFilter);
|
||||
Reference in New Issue
Block a user