Skip to content
Snippets Groups Projects
Commit 14a434bf authored by Nils Destoop's avatar Nils Destoop
Browse files

Merged 8.x-3.x in field layout

parents db60859c 9ab1b996
No related branches found
No related tags found
No related merge requests found
......@@ -169,7 +169,7 @@ function field_group_field_ui_display_form_alter(&$form, FormStateInterface $for
'#type' => 'textfield',
'#default_value' => $group->weight,
'#size' => 3,
'#attributes' => ['class' => ['field-weight'],
'#attributes' => ['class' => ['field-weight']],
],
'parent_wrapper' => [
'parent' => [
......
......@@ -46,6 +46,7 @@ class Accordion extends RenderElement {
// Add the jQuery UI accordion.
$element['#attached']['library'][] = 'field_group/formatter.accordion';
$element['#attached']['library'][] = 'field_group/core';
// Add the effect class.
if (isset($element['#effect'])) {
......
......@@ -47,6 +47,16 @@ class AccordionItem extends FieldGroupFormatterBase {
$element += ['#attributes' => ['class' => $classes]];
}
if ($this->getSetting('required_fields')) {
$element['#attached']['library'][] = 'field_group/formatter.details';
}
foreach ($element as $key => $value) {
if (is_array($value) && !empty($value['#children_errors'])) {
$element['#open'] = TRUE;
}
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment