move to embedded css, update hx state for spinner bug
This commit is contained in:
@@ -50,7 +50,7 @@ func Layout(title string) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<script>\n document.body.addEventListener('htmx:beforeRequest', function(e) {\n e.detail.elt.classList.add('loading');\n });\n\n document.body.addEventListener('htmx:afterRequest', function(e) {\n e.detail.elt.classList.remove('loading');\n });\n </script></body></html>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<script>\n\t\t document.body.addEventListener('htmx:beforeRequest', function(evt) {\n\t evt.detail.elt.classList.add('loading');\n\t\t });\n \n\t\t document.body.addEventListener('htmx:afterRequest', function(evt) {\n\t\t document.querySelectorAll('.loading').forEach(el => {\n\t\t el.classList.remove('loading');\n\t\t });\n\t\t });\n \n\t\t document.body.addEventListener('htmx:beforeSwap', function(evt) {\n\t\t document.querySelectorAll('.loading').forEach(el => {\n\t\t el.classList.remove('loading');\n\t\t });\n\t\t });\n </script></body></html>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
Reference in New Issue
Block a user