Implements hook_preprocess_HOOK() for views-view.html.twig.
function views_ui_preprocess_views_view(&$vars) {
$view = $vars['view'];
if (!empty($view->live_preview) && Drupal::moduleHandler()
->moduleExists('contextual')) {
$view
->setShowAdminLinks(FALSE);
foreach (array(
'title',
'header',
'exposed',
'rows',
'pager',
'more',
'footer',
'empty',
'attachment_after',
'attachment_before',
) as $section) {
if (!empty($vars[$section])) {
$vars[$section] = array(
'#theme' => 'views_ui_view_preview_section',
'#view' => $view,
'#section' => $section,
'#content' => $vars[$section],
'#theme_wrappers' => array(
'views_ui_container',
),
'#attributes' => array(
'class' => 'contextual-region',
),
);
$vars[$section] = $vars[$section];
}
}
}
}