15 lines
377 B
JavaScript
15 lines
377 B
JavaScript
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);
|
|
htmx.on('htmx:beforeSwap', (env) => {
|
|
if (env.detail.xhr.status === 401) {
|
|
window.location = "/login"
|
|
}
|
|
});
|