mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-06-12 17:34:31 +02:00
fix: slow down when page is loaded
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
|
||||
{% include 'includes/scripts/hyperscript/init_tom_select.html' %}
|
||||
{% include 'includes/scripts/hyperscript/init_date_picker.html' %}
|
||||
{% include 'includes/scripts/hyperscript/hide_amount.html' %}
|
||||
{% include 'includes/scripts/hyperscript/tooltip.html' %}
|
||||
{% include 'includes/scripts/hyperscript/htmx_error_handler.html' %}
|
||||
{% include 'includes/scripts/hyperscript/sounds.html' %}
|
||||
{% include 'includes/scripts/hyperscript/swal.html' %}
|
||||
|
||||
@@ -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>#}
|
||||
@@ -23,7 +23,7 @@
|
||||
{% block extra_js_head %}{% endblock %}
|
||||
</head>
|
||||
<body class="font-mono">
|
||||
<div _="install hide_amounts install htmx_error_handler
|
||||
<div _="install htmx_error_handler
|
||||
{% block body_hyperscript %}{% endblock %}"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
||||
{% include 'includes/mobile_navbar.html' %}
|
||||
|
||||
Reference in New Issue
Block a user