You are here

public function BlockDeleteForm::submitFormAjax in Context 8.0

Same name and namespace in other branches
  1. 8.4 src/Reaction/Blocks/Form/BlockDeleteForm.php \Drupal\context\Reaction\Blocks\Form\BlockDeleteForm::submitFormAjax()
  2. 8 src/Reaction/Blocks/Form/BlockDeleteForm.php \Drupal\context\Reaction\Blocks\Form\BlockDeleteForm::submitFormAjax()

Handle when the form is submitted trough AJAX.

Return value

AjaxResponse

File

src/Reaction/Blocks/Form/BlockDeleteForm.php, line 141

Class

BlockDeleteForm

Namespace

Drupal\context\Reaction\Blocks\Form

Code

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