Use partials everywhere

This commit is contained in:
2026-09-06 14:46:29 +02:00
parent ec5b964ac3
commit d0bbdcdfcf
9 changed files with 127 additions and 143 deletions
+13 -6
View File
@@ -7,7 +7,7 @@
*/
// Must be loaded before Apline
import htmx, { HtmxResponse } from "htmx.org";
import htmx from "htmx.org";
import "htmx.org/dist/ext/hx-alpine-compat.js";
import "htmx.org/dist/ext/hx-prompt.js";
import "htmx.org/dist/ext/hx-download.js";
@@ -48,13 +48,20 @@ polyfillCountryFlagEmojis();
/**
* HTMX
*/
document.body.addEventListener("htmx:before:request", (event) => {
event.target.ariaBusy = true;
htmx.registerExtension("aria-busy", {
// biome-ignore lint/style/useNamingConvention: api's name
// biome-ignore lint/suspicious/noExplicitAny: no type hint
htmx_before_request: (_: HTMLElement, detail: any) => {
detail.ctx.target.ariaBusy = "true";
},
// biome-ignore lint/style/useNamingConvention: api's name
// biome-ignore lint/suspicious/noExplicitAny: no type hint
htmx_before_swap: (elt: HTMLElement, detail: any) => {
detail.ctx.target.ariaBusy = "null";
},
});
document.body.addEventListener("htmx:before:swap", (event) => {
event.target.ariaBusy = null;
});
htmx.config.transitions = true;
Object.assign(window, { htmx });