Skip to content

Commit

Permalink
Fix confirm-modal for post onload loaded content
Browse files Browse the repository at this point in the history
  • Loading branch information
alterphp committed May 2, 2019
1 parent 3bf2dad commit c9e8cc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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 @@ -66,7 +66,7 @@ function reloadEmbeddedList(identifier, toggleBaseUrl) {

window.addEventListener('load', function() {
$(function() {
$('[data-confirm]').on('click', function(e) {
$(document).on('click', '[data-confirm]', function(e) {
e.preventDefault();

var message = $(this).data('confirm');
Expand Down
14 changes: 8 additions & 6 deletions src/Resources/views/default/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@
{% block wrapper %}
{{ parent() }}

{% block confirm_modal %}
{{ include('@EasyAdmin/includes/_confirm_modal.html.twig', {
{% block create_entity_modal %}
{{ include('@EasyAdmin/includes/_create_entity_modal.html.twig', {
_translation_domain: _entity_config.translation_domain|default(easyadmin_config('translation_domain')),
_trans_parameters: _trans_parameters|default([]),
}, with_context = false) }}
{% endblock confirm_modal %}
{% endblock create_entity_modal %}

{% block create_entity_modal %}
{{ include('@EasyAdmin/includes/_create_entity_modal.html.twig', {
{% block custom_modals '' %}

{% block confirm_modal %}
{{ include('@EasyAdmin/includes/_confirm_modal.html.twig', {
_translation_domain: _entity_config.translation_domain|default(easyadmin_config('translation_domain')),
_trans_parameters: _trans_parameters|default([]),
}, with_context = false) }}
{% endblock create_entity_modal %}
{% endblock confirm_modal %}
{% endblock %}

0 comments on commit c9e8cc3

Please sign in to comment.