mirror of
https://github.com/ae-utbm/sith.git
synced 2026-09-07 13:04:33 +00:00
Use partials everywhere
This commit is contained in:
@@ -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 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user