]> git.agnieray.net Git - galette.git/commitdiff
Make member dropdown work without extra code
authorJohan Cwiklinski <johan@x-tnd.be>
Sun, 9 Jul 2023 09:29:34 +0000 (11:29 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 9 Jul 2023 09:29:34 +0000 (11:29 +0200)
Changing the linked input type to hidden seems mandatory for selection to work.

galette/templates/default/elements/js/choose_adh.js.twig
galette/templates/default/pages/contribution_form.html.twig
galette/templates/default/pages/member_form.html.twig

index 427ab7f2201c98e7fd07d85d93831de1a7458e67..f2600b9811e5446cbdbc5e17d1e9e681d449b6ea 100644 (file)
                 $('.next-results, .prev-results').addClass('disabled');
             },
         });
+
+        var _chosen_id_input = $('{{ js_chosen_id }}_input');
+        if ( typeof(_chosen_id_input) != 'undefined' && _chosen_id_input != null ) {
+            _chosen_id_input.prop('type', 'hidden');
+        }
     }
 
     $(function() {
index 2716982384a9da0d7724bac08564ca8fc7dbeda5..950b1cd439ae7a1f28c1338cf574d3a12e3ec479 100644 (file)
 {% block javascripts %}
 <script type="text/javascript">
     {% include "elements/js/choose_adh.js.twig" %}
-    document.getElementById('id_adh_input').type = 'hidden';
 
     $(function() {
 
index 7d3280b34c8712bb844186e3c510a0df66240386..1e700d7891f60db32d0d93cda97fe6423dee944e 100644 (file)
 {% block javascripts %}
         <script type="text/javascript">
             {% include "elements/js/choose_adh.js.twig" with {"js_chosen_id": "#parent_id"} %}
-            var _parent_id_input = document.getElementById('parent_id_input');
-            if ( typeof(_parent_id_input) != 'undefined' && _parent_id_input != null ) {
-                document.getElementById('parent_id_input').type = 'hidden';
-            }
 
             $(function() {
                 $('#company_field.nocompany').addClass('displaynone');