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
Boxiang Sun
gitlab-ce
Commits
e35a56c5
Commit
e35a56c5
authored
Jul 18, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fly-out dropdown menu in new sidebar
Closes #34026 [ci skip]
parent
1c7893c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
2 deletions
+62
-2
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+17
-0
app/assets/stylesheets/new_sidebar.scss
app/assets/stylesheets/new_sidebar.scss
+44
-1
app/views/layouts/nav/_new_project_sidebar.html.haml
app/views/layouts/nav/_new_project_sidebar.html.haml
+1
-1
No files found.
app/assets/javascripts/main.js
View file @
e35a56c5
...
...
@@ -347,4 +347,21 @@ $(function () {
gl
.
utils
.
renderTimeago
();
$
(
document
).
trigger
(
'
init.scrolling-tabs
'
);
$
(
'
.sidebar-top-level-items > li:not(.active)
'
).
on
(
'
mouseover
'
,
(
e
)
=>
{
const
windowHeight
=
window
.
innerHeight
;
const
$this
=
e
.
currentTarget
;
const
$subitems
=
$
(
'
.sidebar-sub-level-items
'
,
$this
).
show
();
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
({
top
,
});
}
}).
on
(
'
mouseout
'
,
e
=>
$
(
'
.sidebar-sub-level-items
'
,
e
.
currentTarget
).
hide
());
});
app/assets/stylesheets/new_sidebar.scss
View file @
e35a56c5
...
...
@@ -98,6 +98,7 @@ $new-sidebar-width: 220px;
}
li
{
position
:
relative
;
white-space
:
nowrap
;
a
{
...
...
@@ -126,8 +127,21 @@ $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
{
font-size
:
12px
;
padding
:
8px
16px
8px
24px
;
&
:hover
,
...
...
@@ -152,6 +166,34 @@ $new-sidebar-width: 220px;
.sidebar-top-level-items
{
>
li
{
&
:not
(
.active
)
{
.sidebar-sub-level-items
{
@media
(
min-width
:
$screen-sm-min
)
{
position
:
fixed
;
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
;
border-left
:
0
;
&
:
:
before
{
content
:
""
;
position
:
absolute
;
left
:
0
;
top
:
0
;
width
:
0
;
height
:
0
;
border-style
:
solid
;
border-width
:
21px
12px
;
border-color
:
transparent
transparent
transparent
$hover-background
;
}
}
}
}
.badge
{
float
:
right
;
background-color
:
$inactive-badge-background
;
...
...
@@ -171,6 +213,7 @@ $new-sidebar-width: 220px;
}
}
&
:not
(
.active
)
:hover
>
a
,
>
a
:hover
{
background-color
:
$hover-background
;
color
:
$hover-color
;
...
...
app/views/layouts/nav/_new_project_sidebar.html.haml
View file @
e35a56c5
...
...
@@ -173,7 +173,7 @@
%ul
.sidebar-sub-level-items
-
can_edit
=
can?
(
current_user
,
:admin_project
,
@project
)
-
if
can_edit
=
nav_link
(
controller: :projects
)
do
=
nav_link
(
path:
%w[projects#edit]
)
do
=
link_to
edit_project_path
(
@project
),
title:
'General'
do
%span
General
...
...
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