fix: slow down when page is loaded

This commit is contained in:
Herculino Trotta
2025-11-15 14:55:37 -03:00
parent 7c3120cd43
commit ed3d58f1fd
7 changed files with 37 additions and 50 deletions

View File

@@ -1,32 +0,0 @@
<script type="text/hyperscript">
behavior hide_amounts
on load or htmx:afterSwap if body include #settings-hide-amounts
set elements to <.amount/> in me
for el in elements
set el.textContent to '•••••••••••'
end
end
on load or htmx:afterSwap if body do not include #settings-hide-amounts
set elements to <.amount/> in me
for el in elements
set el.textContent to el.dataset.originalValue
set el.innerHTML to `<span>${el.dataset.originalSign}</span><span>${el.dataset.originalPrefix}</span><span>${el.dataset.originalAmount}</span><span>${el.dataset.originalSuffix}</span>`
end
end
on click[target matches .amount or target.parentNode matches .amount] if I include #settings-hide-amounts
if event.target matches .amount
set el to event.target
else
set el to event.target.parentNode
end
if el do not matches .revealed
then set el.innerHTML to `<span>${el.dataset.originalSign}</span><span>${el.dataset.originalPrefix}</span><span>${el.dataset.originalAmount}</span><span>${el.dataset.originalSuffix}</span>`
else
set el.textContent to '•••••••••••' end
then toggle .revealed on el
end
end
</script>

View File

@@ -1,13 +0,0 @@
{#<script type="text/hyperscript">#}
{#init#}
{# call initiateTooltips()#}
{#end#}
{##}
{#on htmx:afterSettle#}
{# call initiateTooltips()#}
{#end#}
{# #}
{#on tooltips#}
{# call initiateTooltips()#}
{#end#}
{#</script>#}