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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
7d9157ff
Commit
7d9157ff
authored
Jun 15, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clicking body closes nav
Fixed issue when nav wasn't present
parent
9d74eb46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
app/assets/javascripts/sidebar.js.coffee
app/assets/javascripts/sidebar.js.coffee
+16
-0
app/helpers/nav_helper.rb
app/helpers/nav_helper.rb
+2
-1
No files found.
app/assets/javascripts/sidebar.js.coffee
View file @
7d9157ff
...
@@ -14,6 +14,22 @@ toggleSidebar = ->
...
@@ -14,6 +14,22 @@ toggleSidebar = ->
niceScrollBars
.
updateScrollBar
();
niceScrollBars
.
updateScrollBar
();
),
300
),
300
$
(
document
)
.
off
'click'
,
'body'
.
on
'click'
,
'body'
,
(
e
)
->
unless
$
.
cookie
(
'pin_nav'
)
is
'true'
$target
=
$
(
e
.
target
)
$nav
=
$target
.
closest
(
'.sidebar-wrapper'
)
pageExpanded
=
$
(
'.page-with-sidebar'
).
hasClass
(
'page-sidebar-expanded'
)
$toggle
=
$target
.
closest
(
'.toggle-nav-collapse, .side-nav-toggle'
)
if
$nav
.
length
is
0
and
pageExpanded
and
$toggle
.
length
is
0
$
(
'.page-with-sidebar'
)
.
toggleClass
(
'page-sidebar-collapsed page-sidebar-expanded'
)
$
(
'.navbar-fixed-top'
)
.
toggleClass
(
'header-collapsed header-expanded'
)
$
(
document
).
on
(
"click"
,
'.toggle-nav-collapse, .side-nav-toggle'
,
(
e
)
->
$
(
document
).
on
(
"click"
,
'.toggle-nav-collapse, .side-nav-toggle'
,
(
e
)
->
e
.
preventDefault
()
e
.
preventDefault
()
...
...
app/helpers/nav_helper.rb
View file @
7d9157ff
...
@@ -36,7 +36,8 @@ module NavHelper
...
@@ -36,7 +36,8 @@ module NavHelper
end
end
def
nav_header_class
def
nav_header_class
class_name
=
" with-horizontal-nav"
if
defined?
(
nav
)
&&
nav
class_name
=
''
class_name
<<
" with-horizontal-nav"
if
defined?
(
nav
)
&&
nav
if
pinned_nav?
if
pinned_nav?
class_name
<<
" header-expanded header-pinned-nav"
class_name
<<
" header-expanded header-pinned-nav"
...
...
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