You are here

protected function Settings::getTriggerKey in CKEditor Bootstrap Grid 2.0.x

Helper to find the name of the trigger item.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Return value

array The keys to look for.

3 calls to Settings::getTriggerKey()
Settings::addOne in src/Form/Settings.php
Submit handler for the "add-one-more" button.
Settings::ajaxCallback in src/Form/Settings.php
Callback for both ajax-enabled buttons.
Settings::removeCallback in src/Form/Settings.php
Submit handler for the "remove one" button.

File

src/Form/Settings.php, line 251

Class

Settings
Configuration for CKEditor BS Grid.

Namespace

Drupal\ckeditor_bs_grid\Form

Code

protected function getTriggerKey(FormStateInterface $form_state) {
  $trigger = $form_state
    ->getTriggeringElement();
  $parts = explode('-', $trigger['#name']);
  return [
    'break' => $parts[1],
    'col' => $parts[2],
  ];
}