1
Fork 0

show running text

This commit is contained in:
Jan-Erik Rediger 2024-06-03 20:55:29 +02:00
parent 37340eb816
commit 798d3629c7

View file

@ -105,14 +105,14 @@ window.getCode = function getCode() {
} }
let statusElem = document.getElementById("status"); let statusElem = document.getElementById("status");
let indicatorElem = document.getElementById("htmx-indicator");
document.body.addEventListener('htmx:beforeRequest', (event) => { document.body.addEventListener('htmx:beforeRequest', (event) => {
let elem = document.getElementById("htmx-indicator"); indicatorElem.style.display = "inline";
elem.style.display = "inline"; statusElem.innerText = "Running…";
}); });
document.body.addEventListener('htmx:afterRequest', (event) => { document.body.addEventListener('htmx:afterRequest', (event) => {
let elem = document.getElementById("htmx-indicator"); indicatorElem.style.display = "none";
elem.style.display = "none";
}); });
document.body.addEventListener('htmx:beforeSwap', (event) => { document.body.addEventListener('htmx:beforeSwap', (event) => {
let detail = event.detail; let detail = event.detail;