Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
environment_indicator
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
environment_indicator
Merge requests
!5
Issue
#3247637
: Remove background color from Gin Toolbar
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3247637
: Remove background color from Gin Toolbar
issue/environment_indicator-3247637:3247637-improvements-when-using
into
4.x
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
Ignacio Díaz-Roncero
requested to merge
issue/environment_indicator-3247637:3247637-improvements-when-using
into
4.x
3 years ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
Closes
#3247637
0
0
Merge request reports
Compare
4.x
version 2
89dbd2b9
3 years ago
version 1
7e656a1b
3 years ago
4.x (base)
and
latest version
latest version
89dbd2b9
2 commits,
3 years ago
version 2
89dbd2b9
2 commits,
3 years ago
version 1
7e656a1b
1 commit,
3 years ago
1 file
+
13
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
js/environment_indicator.js
+
13
−
4
Options
@@ -13,16 +13,25 @@
Drupal
.
behaviors
.
environmentIndicatorToolbar
=
{
attach
:
function
(
context
,
settings
)
{
if
(
typeof
(
settings
.
environmentIndicator
)
!=
'
undefined
'
)
{
$
(
'
#toolbar-bar
'
,
context
).
css
(
'
background-color
'
,
settings
.
environmentIndicator
.
bgColor
);
$
(
'
#toolbar-bar .toolbar-item, #toolbar-bar .toolbar-item a
'
,
context
).
css
(
'
color
'
,
settings
.
environmentIndicator
.
fgColor
);
// Only apply text and background color color if not using gin_toolbar
if
(
!
$
(
'
body
'
).
hasClass
(
'
gin--vertical-toolbar
'
)
&&
!
$
(
'
body
'
).
hasClass
(
'
gin--horizontal-toolbar
'
))
{
$
(
'
#toolbar-bar
'
,
context
).
css
(
'
background-color
'
,
settings
.
environmentIndicator
.
bgColor
);
$
(
'
#toolbar-bar .toolbar-item, #toolbar-bar .toolbar-item a
'
,
context
).
css
(
'
color
'
,
settings
.
environmentIndicator
.
fgColor
);
}
// Set environment color for gin_toolbar vertical toolbar.
if
(
$
(
'
body
'
).
hasClass
(
'
gin--vertical-toolbar
'
))
{
$
(
'
.toolbar-menu-administration
'
,
context
).
css
(
'
border-color
'
,
settings
.
environmentIndicator
.
bgColor
);
$
(
'
.toolbar-menu-administration
'
,
context
).
css
({
'
border-color
'
:
settings
.
environmentIndicator
.
bgColor
,
'
border-left-width
'
:
'
6px
'
});
$
(
'
.toolbar-tray-horizontal .toolbar-menu li.menu-item
'
,
context
).
css
({
'
margin-left
'
:
'
-3px
'
});
}
// Set environment color for gin_toolbar horizontal toolbar.
if
(
$
(
'
body
'
).
hasClass
(
'
gin--horizontal-toolbar
'
))
{
$
(
'
#toolbar-item-administration-tray
'
).
css
(
'
border-color
'
,
settings
.
environmentIndicator
.
bgColor
);
$
(
'
#toolbar-item-administration-tray
'
).
css
({
'
border-color
'
:
settings
.
environmentIndicator
.
bgColor
,
'
border-top-width
'
:
'
6px
'
});
}
// Set environment color on the icon of the gin_toolbar
if
(
$
(
'
body
'
).
hasClass
(
'
gin--horizontal-toolbar
'
)
||
$
(
'
body
'
).
hasClass
(
'
gin--vertical-toolbar
'
))
{
$
(
'
head
'
,
context
).
append
(
"
<style>.toolbar .toolbar-bar #toolbar-item-administration-tray a.toolbar-icon-admin-toolbar-tools-help.toolbar-icon-default::before{ background-color:
"
+
settings
.
environmentIndicator
.
bgColor
+
"
}</style>
"
);
}
}
}
Loading