From 29a5425259bc1fbf61175ca61fe43c8cd888256d Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 8 Dec 2024 12:31:35 +0100 Subject: [PATCH] Add spinner to student card form --- core/static/bundled/htmx-index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/static/bundled/htmx-index.js b/core/static/bundled/htmx-index.js index 56edea4a..474617ac 100644 --- a/core/static/bundled/htmx-index.js +++ b/core/static/bundled/htmx-index.js @@ -1,3 +1,11 @@ import htmx from "htmx.org"; +document.body.addEventListener("htmx:beforeRequest", (event) => { + event.target.ariaBusy = true; +}); + +document.body.addEventListener("htmx:afterRequest", (event) => { + event.originalTarget.ariaBusy = null; +}); + Object.assign(window, { htmx });