Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4003a3e5
Commit
4003a3e5
authored
Jul 07, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix secondary nav margin handling
parent
ccdc7c7a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
app/assets/javascripts/ee_trial_banner/ee_trial_banner.js
app/assets/javascripts/ee_trial_banner/ee_trial_banner.js
+19
-3
No files found.
app/assets/javascripts/ee_trial_banner/ee_trial_banner.js
View file @
4003a3e5
...
...
@@ -4,12 +4,14 @@ export default class EETrialBanner {
constructor
(
$trialBanner
)
{
this
.
COOKIE_KEY
=
'
show_ee_trial_banner
'
;
this
.
$trialBanner
=
$trialBanner
;
this
.
$navbar
=
this
.
$trialBanner
.
siblings
(
'
.js-navbar-gitlab
'
);
this
.
$mainNavbar
=
this
.
$trialBanner
.
siblings
(
'
.js-navbar-gitlab
'
);
this
.
$secondaryNavbar
=
this
.
$mainNavbar
.
siblings
(
'
.js-page-with-sidebar
'
);
this
.
licenseExpiresOn
=
new
Date
(
this
.
$trialBanner
.
data
(
'
license-expiry
'
));
}
init
()
{
// Wait for navbars to render before querying
this
.
setCookies
();
this
.
$trialBanner
.
on
(
'
close.bs.alert
'
,
e
=>
this
.
handleTrialBannerDismiss
(
e
));
}
...
...
@@ -72,13 +74,27 @@ export default class EETrialBanner {
}
}
toggleMainNavbarMargin
(
state
)
{
if
(
this
.
$mainNavbar
.
length
)
{
this
.
$mainNavbar
.
toggleClass
(
'
has-trial-banner
'
,
state
);
}
}
toggleSecondaryNavbarMargin
(
state
)
{
if
(
this
.
$secondaryNavbar
.
length
)
{
this
.
$secondaryNavbar
.
toggleClass
(
'
has-trial-banner
'
,
state
);
}
}
toggleBanner
(
state
)
{
this
.
$trialBanner
.
toggleClass
(
'
hidden
'
,
!
state
);
this
.
$navbar
.
toggleClass
(
'
has-trial-banner
'
,
state
);
this
.
toggleMainNavbarMargin
(
state
);
this
.
toggleSecondaryNavbarMargin
(
state
);
}
handleTrialBannerDismiss
()
{
this
.
$navbar
.
removeClass
(
'
has-trial-banner
'
);
this
.
toggleMainNavbarMargin
(
false
);
this
.
toggleSecondaryNavbarMargin
(
false
);
if
(
Cookies
.
get
(
this
.
COOKIE_KEY
))
{
Cookies
.
set
(
this
.
COOKIE_KEY
,
'
false
'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment