diff --git a/src/Resources/public/js/easyadmin-extension.js b/src/Resources/public/js/easyadmin-extension.js index fd82db2..eb8a050 100644 --- a/src/Resources/public/js/easyadmin-extension.js +++ b/src/Resources/public/js/easyadmin-extension.js @@ -61,7 +61,7 @@ $(function() { var message = $(this).data('confirm'); var content = $('#modal-confirm p.modal-body-content'); - content.html(typeof message === "string" ? message : content.data('default')); + content.html(message); var confirmButton = $('#modal-confirm #modal-confirm-button'); if (!confirmButton.find('i').length) { confirmButton.prepend(''); } diff --git a/src/Resources/views/default/includes/_actions.html.twig b/src/Resources/views/default/includes/_actions.html.twig index c0c2883..a40d221 100644 --- a/src/Resources/views/default/includes/_actions.html.twig +++ b/src/Resources/views/default/includes/_actions.html.twig @@ -8,8 +8,8 @@ {% endif %} {% set confirm = false %} - {% if action.confirm is defined and action.confirm %} - {% set confirm = action.confirm %} + {% if action.confirm is defined %} + {% set confirm = action.confirm|default('confirm_modal.content'|trans(trans_parameters, 'EasyAdminBundle')) %} {% endif %}