You are here

public function ConditionDeleteForm::submitFormAjax in Context 8

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

Handle when the form is submitted trough AJAX.

Return value

AjaxResponse

File

modules/context_ui/src/Form/ConditionDeleteForm.php, line 131

Class

ConditionDeleteForm

Namespace

Drupal\context_ui\Form

Code

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