Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
split_preview
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
split_preview
Commits
d5a20307
Commit
d5a20307
authored
2 years ago
by
Michael Caldwell
Committed by
Chandravilas Kute
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3274079
by justcaldwell: Remove Admin Toolbar from preview
parent
ccd4b0c0
No related branches found
No related tags found
1 merge request
!2
Add split_preview_preprocess_html()
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
css/live_preview.css
+0
-7
0 additions, 7 deletions
css/live_preview.css
split_preview.module
+13
-0
13 additions, 0 deletions
split_preview.module
with
13 additions
and
7 deletions
css/live_preview.css
+
0
−
7
View file @
d5a20307
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
split_preview.module
+
13
−
0
View file @
d5a20307
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment