You are here

function media_views_pre_render in D7 Media 8

Implements hook_views_pre_render().

Adds the media.view library to the media views.

File

./media.module, line 51
Contains media.module.

Code

function media_views_pre_render(ViewExecutable $view) {
  if (isset($view) && ($view->storage
    ->id() == 'media_library' || $view->storage
    ->id() == 'global_media_library')) {
    $view->element['#attached']['library'][] = 'media/view';
  }
}