You are here

protected function BrowserController::getAjaxAttributes in Layout Builder Browser 8

Get dialog attributes if an ajax request.

Return value

array The attributes array.

1 call to BrowserController::getAjaxAttributes()
BrowserController::getBlocks in src/Controller/BrowserController.php
Gets a render array of block links.

File

src/Controller/BrowserController.php, line 271

Class

BrowserController
Class BrowserController.

Namespace

Drupal\layout_builder_browser\Controller

Code

protected function getAjaxAttributes() {
  if ($this
    ->isAjax()) {
    return [
      'class' => [
        'use-ajax',
      ],
      'data-dialog-type' => 'dialog',
      'data-dialog-renderer' => 'off_canvas',
      'data-dialog-options' => Json::encode([
        'width' => '500px',
      ]),
    ];
  }
  return [];
}