You are here

public function ScheduledTransitionAddForm::revisionProcess in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x src/Form/Entity/ScheduledTransitionAddForm.php \Drupal\scheduled_transitions\Form\Entity\ScheduledTransitionAddForm::revisionProcess()

Add AJAX functionality to revision radios.

Parameters

array $element: The element.

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

array $complete_form: Complete form.

Return value

array The modified element.

File

src/Form/Entity/ScheduledTransitionAddForm.php, line 261

Class

ScheduledTransitionAddForm
Scheduled transitions add form.

Namespace

Drupal\scheduled_transitions\Form\Entity

Code

public function revisionProcess(array &$element, FormStateInterface $form_state, array &$complete_form) : array {

  // Add AJAX to tableselect.
  $newMetaWrapperId = $element['#new_meta_wrapper_id'];
  foreach (Element::children($element) as $key) {
    $element[$key]['#ajax'] = [
      'event' => 'change',
      'callback' => '::ajaxCallbackNewMeta',
      'wrapper' => $newMetaWrapperId,
      'progress' => [
        'type' => 'fullscreen',
      ],
      'effect' => 'fade',
    ];
  }
  return $element;
}