mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-17 23:13:57 +01:00
24 lines
826 B
HTML
24 lines
826 B
HTML
<script type="text/hyperscript">
|
|
behavior hide_amounts
|
|
on load or htmx:afterSwap if I 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 I do not include #settings-hide-amounts
|
|
set elements to <.amount/> in me
|
|
for el in elements
|
|
set el.textContent to el.dataset.originalValue
|
|
end
|
|
end
|
|
|
|
on click[target matches .amount] if I include #settings-hide-amounts
|
|
if event.target do not matches .revealed then set event.target.textContent to event.target.dataset.originalValue
|
|
else set event.target.textContent to '•••••••••••' end
|
|
then toggle .revealed on event.target
|
|
end
|
|
end
|
|
</script>
|