Implement hoverpic using stimulus.

This commit is contained in:
Jan Böhmer 2022-07-29 23:54:49 +02:00
parent 9519150fb9
commit 671e0944a2
6 changed files with 25 additions and 10 deletions

View file

@ -13,7 +13,7 @@
<a target="_blank" data-turbo="false" rel="noopener" href="{{ attachment|entityURL('file_view') }}">
{% endif %}
{% if attachment.picture %}
<img class="hoverpic" data-thumbnail="{{ attachment|entityURL('file_view') }}" src="{{ attachment|entityURL('file_view') }}">
<img class="hoverpic" {{ stimulus_controller('elements/hoverpic') }} data-thumbnail="{{ attachment|entityURL('file_view') }}" src="{{ attachment|entityURL('file_view') }}">
{% else %}
<i class="text-dark {{ class }} {{ ext_to_fa_icon(attachment.extension) }}"></i>
{% endif %}