]> git.agnieray.net Git - galette.git/blobdiff - galette/templates/default/elements/js/modal_action.js.twig
Merge branch 'hotfix/1.0.3'
[galette.git] / galette / templates / default / elements / js / modal_action.js.twig
index 97ef6e8e2eb8fd0b9dcd452e4403f355de2f2bea..e7ebb208a9f2b98d79b4a1df2bb0fb7b40d72c9a 100644 (file)
@@ -52,6 +52,7 @@
  * - modal_approve_text: modal's approve button's text.
  * - modal_approve_icon: modal's approve button's icon.
  * - modal_cancel_text: modal's cancel button's text.
+ * - modal_action_onshow: additionnal code to execute on modal's onShow event.
  *
  * @see loader.js.twig
  * @see modal.js.twig
                 } %}
             },
             error: function() {
+                {# Use "only" keyword to prevent known but not explicitiely defined variables to be passed #}
                 {% include "elements/js/modal.js.twig" with {
                     modal_title_twig: _T("An error occurred :(")|e("js"),
                     modal_without_content: true,
                     modal_deny_only: true,
                     modal_cancel_text: _T("Close")|e("js"),
                     modal_classname: "redalert",
-                } %}
+                } only %}
             }
         });
     });
             inline: false,
             addTouchEvents: false,
         });
+{% if modal_action_onshow is defined %}
+        {{ modal_action_onshow|raw }}
+{% endif %}
     }