Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
view_transitions
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
view_transitions
Commits
ce7d0870
Commit
ce7d0870
authored
Sep 30, 2023
by
Brian Perry
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3387795
: Option to Disable Transitions for Admin Theme
parent
3b503c4f
No related branches found
No related tags found
1 merge request
!7
Issue #3387795: Option to Disable Transitions for Admin Theme
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
view_transitions.module
+14
-1
14 additions, 1 deletion
view_transitions.module
with
14 additions
and
1 deletion
view_transitions.module
+
14
−
1
View file @
ce7d0870
...
...
@@ -31,7 +31,7 @@ function view_transitions_preprocess_html(&$variables) {
$page_transitions
=
\Drupal
::
config
(
'view_transitions.settings'
)
->
get
(
'page_transitions'
);
$animation_type
=
\Drupal
::
config
(
'view_transitions.settings'
)
->
get
(
'animation_type'
);
$transition_in_admin
=
\Drupal
::
config
(
'view_transitions.settings'
)
->
get
(
'transition_in_admin'
);
$is_admin
=
\Drupal
::
service
(
'router.admin_context'
)
->
isAdminRoute
();
$is_admin
=
view_transitions_is_admin
();
// Don't transition on admin pages unless explicitly enabled
if
(
!
$is_admin
||
(
$is_admin
&&
$transition_in_admin
))
{
...
...
@@ -59,3 +59,16 @@ function view_transitions_preprocess_html(&$variables) {
}
}
}
/**
* Determine if the user is at an admin route, or a non-admin route using the toolbar
*/
function
view_transitions_is_admin
()
{
if
(
\Drupal
::
service
(
'router.admin_context'
)
->
isAdminRoute
())
{
return
true
;
}
if
(
\Drupal
::
currentUser
()
->
isAuthenticated
()
&&
\Drupal
::
currentUser
()
->
hasPermission
(
'access toolbar'
))
{
return
true
;
}
return
false
;
}
\ No newline at end of file
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