You are here

function seeds_toolbar_preprocess_item_list__responsive_preview in Seeds Toolbar 8

Implements hook_preprocess_hook().

File

./seeds_toolbar.module, line 331
Contains seeds_toolbar.module.

Code

function seeds_toolbar_preprocess_item_list__responsive_preview(&$variables) {
  $variables['wrapper_attributes']
    ->addClass('toolbar-tray')
    ->removeClass('responsive-preview-item-list');

  // We add a dummy item to mitigate the error in responsive-preview.js:485. Since we now control how the tabs behave.
  $variables["items"]['dummy'] = [
    'value' => [
      '#type' => 'html_tag',
      '#tag' => 'a',
      '#value' => 'dummy',
      '#attributes' => [
        'class' => [
          'visually-hidden',
          'responsive-preview-item-list',
        ],
      ],
    ],
  ];
}