Skip to content
Snippets Groups Projects
Commit a82665c2 authored by Jeremy Isett's avatar Jeremy Isett Committed by Nils Destoop
Browse files

Issue #3044595 by epicflux, adriancid, matt_paz, dercheffe, philosurfer,...

Issue #3044595 by epicflux, adriancid, matt_paz, dercheffe, philosurfer, rfsbsb, nils.destoop, providence_matt, andypost: Field groups are not displayed in layout builder block config forms
parent 988d62c7
No related branches found
No related tags found
No related merge requests found
......@@ -259,6 +259,35 @@ function field_group_inline_entity_form_entity_form_alter(&$entity_form, FormSta
field_group_form_process($entity_form);
}
/**
* Implements hook_form_layout_builder_update_block_alter().
*/
function field_group_form_layout_builder_update_block_alter(&$form, FormStateInterface $form_state) {
// Attach fieldgroups to the layout builder form for custom block types.
if (!isset($form['settings']['block_form']['#block'])) {
return;
}
$context = [
'entity_type' => $form['settings']['block_form']['#block']->getEntityTypeId(),
'bundle' => $form['settings']['block_form']['#block']->bundle(),
'entity' => $form['settings']['block_form']['#block'],
'display_context' => 'form',
'mode' => 'default',
];
field_group_attach_groups($form['settings']['block_form'], $context);
$form['settings']['block_form']['#process'][] = 'field_group_form_process';
}
/**
* Implements hook_form_layout_builder_add_block_alter().
*/
function field_group_form_layout_builder_add_block_alter(&$form, FormStateInterface $form_state) {
// Call the update hook.
field_group_form_layout_builder_update_block_alter($form, $form_state);
}
/**
* Implements hook_entity_view_alter().
*/
......
......@@ -121,7 +121,3 @@ div.field-group-htabs-wrapper .field-group-format-wrapper {
padding: 0 0 0.6em;
}
/*hide*/
.horizontal-tabs .horizontal-tab-hidden {
display: none;
}
......@@ -149,9 +149,11 @@
.each(function () {
var tab = $(this).data('horizontalTab');
tab.details.addClass('horizontal-tab-hidden');
tab.details.hide();
tab.item.removeClass('selected');
})
.end()
.show()
.siblings(':hidden.horizontal-tabs-active-tab')
.val(this.details.attr('id'));
this.item.addClass('selected');
......@@ -175,6 +177,9 @@
tabShow: function () {
// Display the tab.
this.item.removeClass('horizontal-tab-hidden');
this.item.show();
alert('show');
// Update .first marker for items. We need recurse from parent to retain the
// actual DOM element order as jQuery implements sortOrder, but not as public
// method.
......@@ -195,6 +200,9 @@
tabHide: function () {
// Hide this tab.
this.item.addClass('horizontal-tab-hidden');
this.item.hide();
alert('hide');
// Update .first marker for items. We need recurse from parent to retain the
// actual DOM element order as jQuery implements sortOrder, but not as public
// method.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment