You are here

public function GridStackVariantFormController::cancel in GridStack 8.2

Cancels layout changes.

1 string reference to 'GridStackVariantFormController::cancel'
gridstack_ui.routing.yml in modules/gridstack_ui/gridstack_ui.routing.yml
modules/gridstack_ui/gridstack_ui.routing.yml

File

modules/gridstack_ui/src/Controller/GridStackVariantFormController.php, line 143

Class

GridStackVariantFormController
Provides controller to load GridStackVariantForm.

Namespace

Drupal\gridstack_ui\Controller

Code

public function cancel($gridstack, $gid) {
  $pub = $this->request->query
    ->get('pub', NULL);
  $vid = $this->request->query
    ->get('vid', NULL);
  $id = $gridstack
    ->id();
  $config = [
    'gid' => $gid,
    'optionset' => $id,
    'vid' => $vid,
    'pub' => $pub,
  ];
  $editor = $this->manager
    ->stylizer()
    ->builder()
    ->getVariantEditor($config, $gridstack);
  $response = new AjaxResponse();
  $response
    ->addCommand(new ReplaceCommand('#' . GridStackDefault::variantWrapperId($gid), $editor['form']));
  return $response;
}