mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-01 06:53:18 +02:00
fix: slow down when page is loaded
This commit is contained in:
@@ -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>
|
||||
@@ -1,13 +0,0 @@
|
||||
{#<script type="text/hyperscript">#}
|
||||
{#init#}
|
||||
{# call initiateTooltips()#}
|
||||
{#end#}
|
||||
{##}
|
||||
{#on htmx:afterSettle#}
|
||||
{# call initiateTooltips()#}
|
||||
{#end#}
|
||||
{# #}
|
||||
{#on tooltips#}
|
||||
{# call initiateTooltips()#}
|
||||
{#end#}
|
||||
{#</script>#}
|
||||
Reference in New Issue
Block a user