Skip to content

Commit

Permalink
default confirm message when defined but not valued
Browse files Browse the repository at this point in the history
  • Loading branch information
alterphp committed Aug 24, 2018
1 parent ee60273 commit dece12c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Resources/public/js/easyadmin-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('<i></i>'); }
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/default/includes/_actions.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

<a name="{{ action.name }}" class="{{ action.css_class|default('') }}" title="{{ action.title|default('') is empty ? '' : action.title|trans(trans_parameters, translation_domain) }}" {% if not confirm %}href="{{ action_href }}" target="{{ action.target }}"{% else %}href="#" data-href="{{ action_href }}" data-confirm="{{ confirm }}"{% endif %}>
Expand Down

0 comments on commit dece12c

Please sign in to comment.