]> git.agnieray.net Git - galette.git/commitdiff
Remove modals from DOM when hidden by default
authorGuillaume AGNIERAY <dev@agnieray.net>
Fri, 6 Oct 2023 09:18:34 +0000 (11:18 +0200)
committerGuillaume AGNIERAY <dev@agnieray.net>
Fri, 6 Oct 2023 09:18:34 +0000 (11:18 +0200)
fixes #1715

galette/templates/default/elements/js/modal.js.twig
galette/templates/default/pages/members_list.html.twig
galette/templates/default/pages/plugins.html.twig

index e3703020516259df3e4015d9bbc9d5e955a71892..6b3442de407a67df49491a4b60c1d796ce171260 100644 (file)
@@ -94,7 +94,7 @@
 {% if modal_onhidden is defined %}
             {{ modal_onhidden|raw }}
 {% else %}
-            return true;
+            $(this).modal('hide dimmer').remove();
 {% endif %}
         },
         onApprove: function() {
         onDeny: function() {
 {% if modal_ondeny is defined %}
             {{ modal_ondeny|raw }}
+{% else %}
+            return true;
 {% endif %}
         },
         actions: [
index 64f9e20a533e25f82cb7a079f625b7b0f4ac8ff9..852f91b39afa5480455f928d116247266deefff2 100644 (file)
                         modal_without_title: true,
                         modal_class: "tiny",
                         modal_onshow: "_batchAjaxMapper();",
-                        modal_onapprove: "$('#attendance_sheet_details form').submit();",
-                        modal_ondeny: "$(this).modal('hide dimmer').remove();"
+                        modal_onapprove: "$('#attendance_sheet_details form').submit();"
                     } %}
                 },
                 error: function() {
                                     modal_selector: "#mass_contributions",
                                     modal_without_title: true,
                                     modal_content_class: "scrolling",
-                                    modal_onhidden: "$(this).modal('hide dimmer').remove();",
                                     modal_onshow: "_batchAjaxMapper();_formValidationInModal('#mass_contributions');",
-                                    modal_onapprove: "var submitted = _formSubmitInModal('#mass_contributions');if (!submitted){return false;}",
-                                    modal_ondeny: "$(this).modal('hide dimmer').remove();"
+                                    modal_onapprove: "var submitted = _formSubmitInModal('#mass_contributions');if (!submitted){return false;}"
                                 } %}
                             },
                             error: function() {
                         modal_without_title: true,
                         modal_class: "mini",
                         modal_onshow: "_batchAjaxMapper();",
-                        modal_onapprove: "$('#mass_contributions form').submit();",
-                        modal_ondeny: "$(this).modal('hide dimmer').remove();"
+                        modal_onapprove: "$('#mass_contributions form').submit();"
                     } %}
                 },
                 error: function() {
                                 {% include "elements/js/modal.js.twig" with {
                                     modal_selector: "#mass_change",
                                     modal_without_title: true,
-                                    modal_onapprove: "$('#mass_change form').submit();",
-                                    modal_ondeny: "$(this).modal('hide dimmer').remove();"
+                                    modal_onapprove: "$('#mass_change form').submit();"
                                 } %}
                             },
                             error: function() {
                         modal_without_title: true,
                         modal_content_class: "scrolling",
                         modal_onshow: "_massCheckboxes('#mass_change');_batchAjaxMapper();",
-                        modal_onapprove: "$('#mass_change form').submit();",
-                        modal_ondeny: "$(this).modal('hide dimmer').remove();"
+                        modal_onapprove: "$('#mass_change form').submit();"
                     } %}
                 },
                 error: function() {
index 59827c0ea8d7763eef4a3bfcb28e289830c165b8..4230bfa020e63e24a1360415df6402a201846296 100644 (file)
                         observeChanges: true,
                         closable: false
                     },
-                    modal_onhidden: "$(this).modal('hide dimmer').remove();",
                     modal_onapprove: "$('#plugins_initdb_form').submit();return false;",
                     modal_approve_text: _T("Next step")|e("js"),
                     modal_cancel_text: _T("Close")|e("js")