2023-09-18 13:50:03 +01:00
|
|
|
function load() {
|
|
|
|
for (const elm of document.querySelectorAll("form > button")) {
|
|
|
|
elm.addEventListener('click', (e) => {
|
|
|
|
e.target.parentElement.classList.add("submitted");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
window.onload = load;
|
|
|
|
htmx.on('htmx:afterSwap', load);
|
2023-09-19 13:39:59 +01:00
|
|
|
htmx.on('htmx:beforeSwap', (env) => {
|
|
|
|
if (env.detail.xhr.status === 401) {
|
|
|
|
window.location = "/login"
|
|
|
|
}
|
|
|
|
});
|