feat: make item delete confirm on click and directly delete on shift+click

This behavior is similar to how Discord handles the delete button
This commit is contained in:
Herculino Trotta
2024-09-27 17:47:55 -03:00
parent dff1f07f0e
commit c5c44472bd
+16 -14
View File
@@ -63,20 +63,22 @@ hover:tw-bg-zinc-900 p-2 {% if transaction.account.is_asset %}tw-border-dashed{%
on mouseenter call bootstrap.Tooltip.getOrCreateInstance(me) end on mouseenter call bootstrap.Tooltip.getOrCreateInstance(me) end
on mouseleave call bootstrap.Tooltip.getOrCreateInstance(me).dispose() end on mouseleave call bootstrap.Tooltip.getOrCreateInstance(me).dispose() end
on click on click
call Swal.fire({title: '{% translate 'Are you sure?' %}', if event.shiftKey trigger confirmed
text: '{% blocktranslate %}You won\'t be able to revert this!{% endblocktranslate %}', else
icon: 'warning', call Swal.fire({title: '{% translate 'Are you sure?' %}',
showCancelButton: true, text: '{% blocktranslate %}You won\'t be able to revert this!{% endblocktranslate %}',
confirmButtonColor: '#3085d6', icon: 'warning',
cancelButtonColor: '#d33', showCancelButton: true,
cancelButtonText: '{% blocktranslate %}Cancel{% endblocktranslate %}', confirmButtonColor: '#3085d6',
confirmButtonText: '{% blocktranslate %}Yes, delete it!{% endblocktranslate %}', cancelButtonColor: '#d33',
customClass: { cancelButtonText: '{% blocktranslate %}Cancel{% endblocktranslate %}',
confirmButton: 'btn btn-primary me-3', confirmButtonText: '{% blocktranslate %}Yes, delete it!{% endblocktranslate %}',
cancelButton: 'btn btn-danger' customClass: {
}, confirmButton: 'btn btn-primary me-3',
buttonsStyling: false}) cancelButton: 'btn btn-danger'
if result.isConfirmed trigger confirmed"><i class="fa-solid fa-trash fa-fw"></i></a> },
buttonsStyling: false})
if result.isConfirmed trigger confirmed"><i class="fa-solid fa-trash fa-fw"></i></a>
<a class="text-decoration-none tw-text-gray-400 p-2 transaction-action" <a class="text-decoration-none tw-text-gray-400 p-2 transaction-action"
role="button" role="button"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"