diff --git a/field_group.module b/field_group.module index 98eba37..8a51b7a 100644 --- a/field_group.module +++ b/field_group.module @@ -294,6 +294,7 @@ function field_group_form_process(array &$element) { $group_children_parent_group = implode('][', $parents); foreach ($group->children as $child) { $element[$child]['#group'] = $group_children_parent_group; + $element[$child]['#attributes']['class'][] = 'field-group-child-field'; } } @@ -593,7 +594,6 @@ function field_group_fields_nest(&$element, &$vars = NULL, $context = NULL) { // If this is a group, we have to use a reference to keep the reference // list intact (but if it is a field we don't mind). $group_references[$parent_name][$child_name] = &$element[$child_name]; - $group_references[$parent_name][$child_name]['#attributes']['class'][] = 'field-group-child-field'; // Remove the #group property, otherwise core will move this element to // the field layout region. diff --git a/js/field_group.js b/js/field_group.js index 9f15824..daddcc2 100644 --- a/js/field_group.js +++ b/js/field_group.js @@ -54,7 +54,7 @@ }); $(document).ready(function () { - $(context).find('.field-group').each(function() { + $(context).find('.field-group, .accordion-item').each(function() { hideGroupIfEmpty($(this)); }); });