瀏覽代碼

add field groups option

Thomas 14 年之前
父節點
當前提交
cf9c468c40
共有 2 個文件被更改,包括 2 次插入8 次删除
  1. 2 6
      Resources/public/base.js
  2. 0 2
      Resources/views/CRUD/edit_many_association_script.twig

+ 2 - 6
Resources/public/base.js

@@ -1,8 +1,7 @@
 jQuery(document).ready(function() {
 
     BaseApplication.add_pretty_errors(document);
-    BaseApplication.add_collapsed_toggle(document);
-
+    BaseApplication.add_collapsed_toggle();
 });
 
 
@@ -46,7 +45,7 @@ var BaseApplication = {
     },
 
     add_collapsed_toggle: function(subject) {
-        jQuery('fieldset legend a.sonata-ba-collapsed', subject).click(function(event) {
+        jQuery('fieldset legend a.sonata-ba-collapsed', subject).live('click', function(event) {
             event.preventDefault();
 
             var fieldset = jQuery(this).closest('fieldset');
@@ -54,8 +53,5 @@ var BaseApplication = {
             jQuery('div.sonata-ba-collapsed-fields', fieldset).toggle();
             fieldset.toggleClass('sonata-ba-collapsed-fields-close');
         });
-
-         jQuery('fieldset legend a.sonata-ba-collapsed', subject).trigger('click');
-        
     }
 }

+ 0 - 2
Resources/views/CRUD/edit_many_association_script.twig

@@ -92,7 +92,6 @@ This code manage the many-to-[one|many] association field popup
                 field_dialog_{{ configuration.code }}_{{ field_element.id }}.html(html);
 
                 BaseApplication.add_pretty_errors(field_dialog_{{ configuration.code }}_{{ field_element.id }});
-                BaseApplication.add_collapsed_toggle(field_dialog_{{ configuration.code }}_{{ field_element.id }});
 
                 // reattach the event
                 jQuery('form', field_dialog_{{ configuration.code }}_{{ field_element.id }}).submit(field_dialog_form_action_{{ configuration.code }}_{{ field_element.id }});
@@ -129,6 +128,5 @@ This code manage the many-to-[one|many] association field popup
     }
 
     BaseApplication.add_pretty_errors(field_dialog_{{ configuration.code }}_{{ field_element.id }});
-    BaseApplication.add_collapsed_toggle(field_dialog_{{ configuration.code }}_{{ field_element.id }});
     
 </script>