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
ad633afd
Commit
ad633afd
authored
Jul 19, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transform the position
correctly position the arrow fix scss lint
parent
e35a56c5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
21 deletions
+38
-21
main.js
app/assets/javascripts/main.js
+13
-3
new_sidebar.scss
app/assets/stylesheets/new_sidebar.scss
+25
-18
No files found.
app/assets/javascripts/main.js
View file @
ad633afd
...
...
@@ -348,6 +348,9 @@ $(function () {
$
(
document
).
trigger
(
'init.scrolling-tabs'
);
const
style
=
document
.
createElement
(
"style"
);
document
.
head
.
appendChild
(
style
);
$
(
'.sidebar-top-level-items > li:not(.active)'
).
on
(
'mouseover'
,
(
e
)
=>
{
const
windowHeight
=
window
.
innerHeight
;
const
$this
=
e
.
currentTarget
;
...
...
@@ -355,13 +358,20 @@ $(function () {
if
(
$subitems
.
length
)
{
const
boundingRect
=
$this
.
getBoundingClientRect
();
const
bottomOverflow
=
windowHeight
-
(
boundingRect
.
top
+
$subitems
.
outerHeight
());
const
top
=
bottomOverflow
<
0
?
boundingRect
.
top
-
Math
.
abs
(
bottomOverflow
)
:
boundingRect
.
top
;
$subitems
.
css
({
t
op
,
t
ransform
:
`translate3d(0,
${
top
}
px, 0)`
,
});
style
.
sheet
.
insertRule
(
`.sidebar-sub-level-items::before { transform: translate3d(0,
${
boundingRect
.
top
-
top
}
px, 0); }`
,
0
);
}
}).
on
(
'mouseout'
,
e
=>
$
(
'.sidebar-sub-level-items'
,
e
.
currentTarget
).
hide
());
}).
on
(
'mouseout'
,
(
e
)
=>
{
$
(
'.sidebar-sub-level-items'
,
e
.
currentTarget
).
hide
();
if
(
style
.
sheet
.
rules
.
length
)
{
style
.
sheet
.
deleteRule
(
0
);
}
});
});
app/assets/stylesheets/new_sidebar.scss
View file @
ad633afd
...
...
@@ -98,7 +98,6 @@ $new-sidebar-width: 220px;
}
li
{
position
:
relative
;
white-space
:
nowrap
;
a
{
...
...
@@ -127,20 +126,6 @@ $new-sidebar-width: 220px;
padding-bottom
:
8px
;
>
li
{
&
:not
(
.active
)
{
@media
(
min-width
:
$screen-sm-min
)
{
a
{
padding
:
11px
16px
11px
24px
;
&
:hover
,
&
:focus
{
background
:
transparent
;
font-weight
:
600
;
}
}
}
}
a
{
padding
:
8px
16px
8px
24px
;
...
...
@@ -170,13 +155,14 @@ $new-sidebar-width: 220px;
.sidebar-sub-level-items
{
@media
(
min-width
:
$screen-sm-min
)
{
position
:
fixed
;
top
:
0
;
left
:
220px
;
width
:
150px
;
margin-left
:
-1px
;
padding-bottom
:
0
;
background-color
:
#fff
;
box-shadow
:
2px
1px
3px
rgba
(
0
,
0
,
0
,.
1
)
;
border
:
1px
solid
#e5e5e5
;
background-color
:
$white-light
;
box-shadow
:
2px
1px
3px
$dropdown-shadow-color
;
border
:
1px
solid
$dropdown-border-color
;
border-left
:
0
;
&
:
:
before
{
...
...
@@ -189,6 +175,27 @@ $new-sidebar-width: 220px;
border-style
:
solid
;
border-width
:
21px
12px
;
border-color
:
transparent
transparent
transparent
$hover-background
;
pointer-events
:
none
;
}
&
:
:
after
{
content
:
""
;
position
:
absolute
;
top
:
44px
;
left
:
-20px
;
right
:
0
;
bottom
:
0
;
z-index
:
-1
;
}
a
{
padding
:
11px
16px
11px
24px
;
&
:hover
,
&
:focus
{
background
:
transparent
;
font-weight
:
600
;
}
}
}
}
...
...
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