You are here

protected function LayoutBuilderBrowserEventSubscriber::getAjaxAttributes in Gin Layout Builder 8.2

Get dialog attributes if an ajax request.

Return value

array The attributes array.

1 call to LayoutBuilderBrowserEventSubscriber::getAjaxAttributes()
LayoutBuilderBrowserEventSubscriber::getLibrarySectionLinks in modules/wingsuit_lb/src/EventSubscriber/LayoutBuilderBrowserEventSubscriber.php
Gets a render array of section links.

File

modules/wingsuit_lb/src/EventSubscriber/LayoutBuilderBrowserEventSubscriber.php, line 189

Class

LayoutBuilderBrowserEventSubscriber
Class LayoutBuilderBrowserEventSubscriber.

Namespace

Drupal\wingsuit_lb\EventSubscriber

Code

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