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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
2778549e
Commit
2778549e
authored
7 years ago
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show the sidebar scroll bars if the user can scroll
Closes #37972
parent
1f491154
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
app/assets/javascripts/new_sidebar.js
app/assets/javascripts/new_sidebar.js
+11
-0
app/assets/stylesheets/new_sidebar.scss
app/assets/stylesheets/new_sidebar.scss
+5
-1
No files found.
app/assets/javascripts/new_sidebar.js
View file @
2778549e
...
...
@@ -11,6 +11,7 @@ export default class NewNavSidebar {
initDomElements
()
{
this
.
$page
=
$
(
'
.page-with-sidebar
'
);
this
.
$sidebar
=
$
(
'
.nav-sidebar
'
);
this
.
$innerScroll
=
$
(
'
.nav-sidebar-inner-scroll
'
,
this
.
$sidebar
);
this
.
$overlay
=
$
(
'
.mobile-overlay
'
);
this
.
$openSidebar
=
$
(
'
.toggle-mobile-nav
'
);
this
.
$closeSidebar
=
$
(
'
.close-nav-button
'
);
...
...
@@ -55,6 +56,16 @@ export default class NewNavSidebar {
this
.
$page
.
toggleClass
(
'
page-with-icon-sidebar
'
,
breakpoint
===
'
sm
'
?
true
:
collapsed
);
}
NewNavSidebar
.
setCollapsedCookie
(
collapsed
);
this
.
toggleSidebarOverflow
();
}
toggleSidebarOverflow
()
{
if
(
this
.
$innerScroll
.
prop
(
'
scrollHeight
'
)
>
this
.
$innerScroll
.
prop
(
'
offsetHeight
'
))
{
this
.
$innerScroll
.
css
(
'
overflow-y
'
,
'
scroll
'
);
}
else
{
this
.
$innerScroll
.
css
(
'
overflow-y
'
,
''
);
}
}
render
()
{
...
...
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/new_sidebar.scss
View file @
2778549e
...
...
@@ -192,7 +192,11 @@ $new-sidebar-collapsed-width: 50px;
.nav-sidebar-inner-scroll
{
height
:
100%
;
width
:
100%
;
overflow
:
scroll
;
overflow
:
auto
;
@media
(
min-width
:
$screen-sm-min
)
{
overflow
:
hidden
;
}
}
.with-performance-bar
.nav-sidebar
{
...
...
This diff is collapsed.
Click to expand it.
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