diff --git a/static/app.ts b/static/app.ts index ae5be25..dd41a8c 100644 --- a/static/app.ts +++ b/static/app.ts @@ -4,7 +4,6 @@ import "./htmx"; import "./dropdown"; import "./anime"; import "./search"; -import "./sort_filter"; import "./dedupe"; import "./watchlist"; import "./top_pick_carousel"; diff --git a/static/sort_filter.ts b/static/sort_filter.ts deleted file mode 100644 index 03f777d..0000000 --- a/static/sort_filter.ts +++ /dev/null @@ -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);