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
9ddc62cc
Commit
9ddc62cc
authored
Sep 16, 2017
by
Phil Hughes
Committed by
Annabel Dunstone Gray
Sep 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the new sidebars width when browser has scrollbars
parent
a70c76df
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
9 deletions
+23
-9
fly_out_nav.js
app/assets/javascripts/fly_out_nav.js
+2
-1
new_sidebar.scss
app/assets/stylesheets/new_sidebar.scss
+8
-7
fix-sidebar-with-scrollbars.yml
changelogs/unreleased/fix-sidebar-with-scrollbars.yml
+5
-0
fly_out_nav_spec.js
spec/javascripts/fly_out_nav_spec.js
+8
-1
No files found.
app/assets/javascripts/fly_out_nav.js
View file @
9ddc62cc
...
@@ -77,10 +77,11 @@ export const hideMenu = (el) => {
...
@@ -77,10 +77,11 @@ export const hideMenu = (el) => {
export
const
moveSubItemsToPosition
=
(
el
,
subItems
)
=>
{
export
const
moveSubItemsToPosition
=
(
el
,
subItems
)
=>
{
const
boundingRect
=
el
.
getBoundingClientRect
();
const
boundingRect
=
el
.
getBoundingClientRect
();
const
top
=
calculateTop
(
boundingRect
,
subItems
.
offsetHeight
);
const
top
=
calculateTop
(
boundingRect
,
subItems
.
offsetHeight
);
const
left
=
sidebar
?
sidebar
.
offsetWidth
:
50
;
const
isAbove
=
top
<
boundingRect
.
top
;
const
isAbove
=
top
<
boundingRect
.
top
;
subItems
.
classList
.
add
(
'fly-out-list'
);
subItems
.
classList
.
add
(
'fly-out-list'
);
subItems
.
style
.
transform
=
`translate3d(
0
,
${
Math
.
floor
(
top
)
-
headerHeight
}
px, 0)`
;
// eslint-disable-line no-param-reassign
subItems
.
style
.
transform
=
`translate3d(
${
left
}
px
,
${
Math
.
floor
(
top
)
-
headerHeight
}
px, 0)`
;
// eslint-disable-line no-param-reassign
const
subItemsRect
=
subItems
.
getBoundingClientRect
();
const
subItemsRect
=
subItems
.
getBoundingClientRect
();
...
...
app/assets/stylesheets/new_sidebar.scss
View file @
9ddc62cc
...
@@ -105,7 +105,8 @@ $new-sidebar-collapsed-width: 50px;
...
@@ -105,7 +105,8 @@ $new-sidebar-collapsed-width: 50px;
}
}
&
.sidebar-icons-only
{
&
.sidebar-icons-only
{
width
:
$new-sidebar-collapsed-width
;
width
:
auto
;
min-width
:
$new-sidebar-collapsed-width
;
.nav-sidebar-inner-scroll
{
.nav-sidebar-inner-scroll
{
overflow-x
:
hidden
;
overflow-x
:
hidden
;
...
@@ -124,6 +125,10 @@ $new-sidebar-collapsed-width: 50px;
...
@@ -124,6 +125,10 @@ $new-sidebar-collapsed-width: 50px;
.fly-out-top-item
{
.fly-out-top-item
{
display
:
block
;
display
:
block
;
}
}
.avatar-container
{
margin-right
:
0
;
}
}
}
&
.nav-sidebar-expanded
{
&
.nav-sidebar-expanded
{
...
@@ -187,7 +192,7 @@ $new-sidebar-collapsed-width: 50px;
...
@@ -187,7 +192,7 @@ $new-sidebar-collapsed-width: 50px;
.nav-sidebar-inner-scroll
{
.nav-sidebar-inner-scroll
{
height
:
100%
;
height
:
100%
;
width
:
100%
;
width
:
100%
;
overflow
:
auto
;
overflow
:
scroll
;
}
}
.with-performance-bar
.nav-sidebar
{
.with-performance-bar
.nav-sidebar
{
...
@@ -248,7 +253,7 @@ $new-sidebar-collapsed-width: 50px;
...
@@ -248,7 +253,7 @@ $new-sidebar-collapsed-width: 50px;
@media
(
min-width
:
$screen-sm-min
)
{
@media
(
min-width
:
$screen-sm-min
)
{
position
:
fixed
;
position
:
fixed
;
top
:
0
;
top
:
0
;
left
:
$new-sidebar-width
;
left
:
0
;
min-width
:
150px
;
min-width
:
150px
;
margin-top
:
-1px
;
margin-top
:
-1px
;
padding
:
4px
1px
;
padding
:
4px
1px
;
...
@@ -386,10 +391,6 @@ $new-sidebar-collapsed-width: 50px;
...
@@ -386,10 +391,6 @@ $new-sidebar-collapsed-width: 50px;
}
}
.sidebar-sub-level-items
{
.sidebar-sub-level-items
{
@media
(
min-width
:
$screen-sm-min
)
{
left
:
$new-sidebar-collapsed-width
;
}
&
:not
(
.flyout-list
)
{
&
:not
(
.flyout-list
)
{
display
:
none
;
display
:
none
;
}
}
...
...
changelogs/unreleased/fix-sidebar-with-scrollbars.yml
0 → 100644
View file @
9ddc62cc
---
title
:
Fixed the sidebar scrollbar overlapping links
merge_request
:
author
:
type
:
fixed
spec/javascripts/fly_out_nav_spec.js
View file @
9ddc62cc
...
@@ -271,12 +271,19 @@ describe('Fly out sidebar navigation', () => {
...
@@ -271,12 +271,19 @@ describe('Fly out sidebar navigation', () => {
});
});
it
(
'sets transform of sub-items'
,
()
=>
{
it
(
'sets transform of sub-items'
,
()
=>
{
const
sidebar
=
document
.
createElement
(
'div'
);
const
subItems
=
el
.
querySelector
(
'.sidebar-sub-level-items'
);
const
subItems
=
el
.
querySelector
(
'.sidebar-sub-level-items'
);
sidebar
.
style
.
width
=
'200px'
;
document
.
body
.
appendChild
(
sidebar
);
setSidebar
(
sidebar
);
showSubLevelItems
(
el
);
showSubLevelItems
(
el
);
expect
(
expect
(
subItems
.
style
.
transform
,
subItems
.
style
.
transform
,
).
toBe
(
`translate3d(0px,
${
Math
.
floor
(
el
.
getBoundingClientRect
().
top
)
-
getHeaderHeight
()}
px, 0px)`
);
).
toBe
(
`translate3d(
20
0px,
${
Math
.
floor
(
el
.
getBoundingClientRect
().
top
)
-
getHeaderHeight
()}
px, 0px)`
);
});
});
it
(
'sets is-above when element is above'
,
()
=>
{
it
(
'sets is-above when element is above'
,
()
=>
{
...
...
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