You are here

public function ReactionDeleteForm::submitFormAjax in Context 8

Same name and namespace in other branches
  1. 8.4 modules/context_ui/src/Form/ReactionDeleteForm.php \Drupal\context_ui\Form\ReactionDeleteForm::submitFormAjax()
  2. 8.0 modules/context_ui/src/Form/ReactionDeleteForm.php \Drupal\context_ui\Form\ReactionDeleteForm::submitFormAjax()

Handle when the form is submitted through AJAX.

Return value

AjaxResponse

File

modules/context_ui/src/Form/ReactionDeleteForm.php, line 133

Class

ReactionDeleteForm

Namespace

Drupal\context_ui\Form

Code

public function submitFormAjax() {
  $response = new AjaxResponse();
  $contextForm = $this->contextManager
    ->getForm($this->context, 'edit');
  $response
    ->addCommand(new CloseModalDialogCommand());
  $response
    ->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions']));
  return $response;
}