You are here

public function HeartbeatUpdateFeedForm::prepareAjaxForm in Heartbeat 8

File

src/Form/HeartbeatUpdateFeedForm.php, line 157

Class

HeartbeatUpdateFeedForm
Class HeartbeatUpdateFeedForm.

Namespace

Drupal\heartbeat\Form

Code

public function prepareAjaxForm(&$form) {
  if (!isset($form['#value'])) {
    $form['#value'] = isset($form['#default_value']) ? $form['#default_value'] : '';
  }
  if (isset($form['#type'])) {
    if ($form['#type'] == 'submit') {
      $form = RenderElement::preRenderAjaxForm($form);
    }
  }
  foreach (Element::children($form) as $key) {
    $element =& $form[$key];
    $this
      ->prepareAjaxForm($element);
  }
}