diff -u b/css/paragraphs.admin.css b/css/paragraphs.admin.css --- b/css/paragraphs.admin.css +++ b/css/paragraphs.admin.css @@ -121,6 +121,9 @@ .js .ui-tabs-nav .ui-state-active { background-color: #fff; } +.js .ui-tabs-panel { + padding: initial; +} /* Override 600px breakpoint core submit button tweaks. */ @media screen and (max-width: 600px) { diff -u b/js/paragraphs.js b/js/paragraphs.js --- b/js/paragraphs.js +++ b/js/paragraphs.js @@ -19,6 +19,10 @@ $('.paragraphs-nested.paragraphs-subform').show(); $('.paragraphs-behavior').show(); } + }, + create: function( event, ui ) { + $('.paragraphs-subform').show(); + $('.paragraphs-behavior').hide(); } }); }); diff -u b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php --- b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php +++ b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php @@ -549,6 +549,8 @@ $element['subform']['#pre_render'][] = 'field_group_form_pre_render'; } + // @todo do something here with the display variable. + if ($item_mode == 'edit') { $display->buildForm($paragraphs_entity, $element['subform'], $form_state); foreach (Element::children($element['subform']) as $field) { @@ -721,21 +723,18 @@ $elements = array(); + $tabs = ''; // If the parent entity is paragraph add the nested class if not then add // the perspective tabs. if ($items->getEntity()->getEntityTypeId() != 'paragraph') { - $form['perspective_tabs'] = [ - '#type' => 'markup', - '#markup' => '', - '#weight' => 30, - ]; + $tabs = ''; } else { $form['#attributes']['class'][] = 'paragraphs-nested'; } $id_prefix = implode('-', array_merge($parents, array($field_name))); $wrapper_id = Html::getUniqueId($id_prefix . '-add-more-wrapper'); - $elements['#prefix'] = '
'; + $elements['#prefix'] = '
' . $tabs; $elements['#suffix'] = '
'; $field_state['ajax_wrapper_id'] = $wrapper_id;