mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 23:56:22 +00:00
fix: al salir de la página, cancelar todas las peticiones de htmx
closes #15880 closes #15881 closes #15883 closes #15884 closes #15893 closes #15894 closes #15973 closes #15974 closes #15975 closes #16003 closes #16004
This commit is contained in:
parent
629549c916
commit
7cca88b4f3
2 changed files with 8 additions and 0 deletions
7
app/javascript/etc/htmx_abort.js
Normal file
7
app/javascript/etc/htmx_abort.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
// 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");
|
||||||
|
}
|
||||||
|
});
|
|
@ -7,3 +7,4 @@ import './timezone'
|
||||||
import './turbolinks-anchors'
|
import './turbolinks-anchors'
|
||||||
import './validation'
|
import './validation'
|
||||||
import './new_editor'
|
import './new_editor'
|
||||||
|
import './htmx_abort'
|
||||||
|
|
Loading…
Reference in a new issue