Skip to content
Snippets Groups Projects
Commit d5a20307 authored by Michael Caldwell's avatar Michael Caldwell Committed by Chandravilas Kute
Browse files

Issue #3274079 by justcaldwell: Remove Admin Toolbar from preview

parent ccd4b0c0
No related branches found
No related tags found
1 merge request!2Add split_preview_preprocess_html()
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
right: 0; right: 0;
z-index: 1000; z-index: 1000;
height: 100%; height: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%; width: 100%;
} }
...@@ -28,12 +25,8 @@ ...@@ -28,12 +25,8 @@
} }
.live-preview__actions { .live-preview__actions {
position: absolute;
top: 0;
right: 0;
padding: 2px 0; padding: 2px 0;
background: black; background: black;
width: 100%;
text-align: right; text-align: right;
transition: all 0.5s; transition: all 0.5s;
} }
......
...@@ -61,6 +61,18 @@ function split_preview_form_alter(array &$form, FormStateInterface $form_state, ...@@ -61,6 +61,18 @@ function split_preview_form_alter(array &$form, FormStateInterface $form_state,
} }
} }
/**
* Implements hook_preprocess_HOOK().
*/
function split_preview_preprocess_html(&$variables) {
$split_preview = \Drupal::request()->query->get('split_preview');
if ($split_preview === 'true') {
if (isset($variables['page_top']['toolbar'])) {
unset($variables['page_top']['toolbar']);
}
}
}
/** /**
* Ajax submit ajax handler form. * Ajax submit ajax handler form.
* *
...@@ -101,6 +113,7 @@ function _submit_ajax_form(array &$form, FormStateInterface $form_state) { ...@@ -101,6 +113,7 @@ function _submit_ajax_form(array &$form, FormStateInterface $form_state) {
$route_parameters = [ $route_parameters = [
'node_preview' => $uuid, 'node_preview' => $uuid,
'view_mode_id' => 'full', 'view_mode_id' => 'full',
'split_preview' => 'true',
]; ];
// Setting preview node url. // Setting preview node url.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment