5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 20:36:21 +00:00
panel/app/javascript/etc/htmx_abort.js

12 lines
347 B
JavaScript
Raw Normal View History

// Cancela las peticiones pendientes de htmx para todos los elementos al
// cambiar de página.
document.addEventListener("turbolinks:click", () => {
for (const hx of document.querySelectorAll("[hx-get]")) {
window.htmx.trigger(hx, "htmx:abort");
}
});
2024-05-17 18:24:08 +00:00
document.addEventListener("htmx:resetForm", (event) => {
event.target.reset();
});