BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
sidebar.js.coffee
app/assets/javascripts/sidebar.js.coffee
+16
-0
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 = ->
niceScrollBars
.
updateScrollBar
();
),
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
)
->
e
.
preventDefault
()
...
...
app/helpers/nav_helper.rb
View file @
7d9157ff
...
...
@@ -36,7 +36,8 @@ module NavHelper
end
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?
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