You are here

public static function ParagraphsStylePlugin::updateDefaultStyle in Paragraphs Collection 8

Ajax callback for the style group dropdown.

File

src/Plugin/paragraphs/Behavior/ParagraphsStylePlugin.php, line 223

Class

ParagraphsStylePlugin
Provides style selection plugin.

Namespace

Drupal\paragraphs_collection\Plugin\paragraphs\Behavior

Code

public static function updateDefaultStyle(array $form, FormStateInterface $form_state) {
  $group_select = $form_state
    ->getTriggeringElement();

  // Gets the behavior plugin settings form.
  $settings_form = NestedArray::getValue($form, array_slice($group_select['#array_parents'], 0, -2));
  return $settings_form['groups_defaults'];
}