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
cb83c50d
Commit
cb83c50d
authored
7 years ago
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mobile navigation on project page
parent
fe0c3b79
No related merge requests found
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
28 deletions
+114
-28
app/assets/javascripts/layout_nav.js
app/assets/javascripts/layout_nav.js
+2
-0
app/assets/javascripts/new_sidebar.js
app/assets/javascripts/new_sidebar.js
+23
-0
app/assets/stylesheets/new_nav.scss
app/assets/stylesheets/new_nav.scss
+1
-2
app/assets/stylesheets/new_sidebar.scss
app/assets/stylesheets/new_sidebar.scss
+78
-21
app/views/layouts/nav/_breadcrumbs.html.haml
app/views/layouts/nav/_breadcrumbs.html.haml
+2
-0
app/views/layouts/nav/_new_project_sidebar.html.haml
app/views/layouts/nav/_new_project_sidebar.html.haml
+8
-5
No files found.
app/assets/javascripts/layout_nav.js
View file @
cb83c50d
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, no-unused-vars, one-var, one-var-declaration-per-line, vars-on-top, max-len */
import
_
from
'
underscore
'
;
import
NewNavSidebar
from
'
./new_sidebar
'
;
(
function
()
{
var
hideEndFade
;
...
...
@@ -53,6 +54,7 @@ import _ from 'underscore';
}
$
(()
=>
{
new
NewNavSidebar
();
$
(
window
).
on
(
'
scroll
'
,
_
.
throttle
(
applyScrollNavClass
,
100
));
});
}).
call
(
window
);
This diff is collapsed.
Click to expand it.
app/assets/javascripts/new_sidebar.js
0 → 100644
View file @
cb83c50d
const
SIDEBAR_EXPANDED_CLASS
=
'
nav-sidebar-expanded
'
;
export
default
class
NewNavSidebar
{
constructor
()
{
this
.
initDomElements
();
this
.
bindEvents
();
}
initDomElements
()
{
this
.
$sidebar
=
$
(
'
.nav-sidebar
'
);
this
.
$openSidebar
=
$
(
'
.toggle-mobile-nav
'
);
this
.
$closeSidebar
=
$
(
'
.close-nav-button
'
);
}
bindEvents
()
{
this
.
$openSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
true
));
this
.
$closeSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
false
));
}
toggleSidebarNav
(
show
)
{
this
.
$sidebar
.
toggleClass
(
SIDEBAR_EXPANDED_CLASS
,
show
);
}
}
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/new_nav.scss
View file @
cb83c50d
...
...
@@ -275,8 +275,6 @@ header.navbar-gitlab-new {
.breadcrumbs
{
display
:
flex
;
min-height
:
60px
;
padding-top
:
$gl-padding-top
;
padding-bottom
:
$gl-padding-top
;
color
:
$gl-text-color
;
border-bottom
:
1px
solid
$border-color
;
...
...
@@ -300,6 +298,7 @@ header.navbar-gitlab-new {
display
:
flex
;
width
:
100%
;
position
:
relative
;
align-items
:
center
;
.dropdown-menu-projects
{
margin-top
:
-
$gl-padding
;
...
...
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/new_sidebar.scss
View file @
cb83c50d
...
...
@@ -26,6 +26,9 @@ $new-sidebar-width: 220px;
}
.context-header
{
position
:
relative
;
a
{
border-bottom
:
1px
solid
$border-color
;
font-weight
:
600
;
display
:
flex
;
...
...
@@ -33,9 +36,8 @@ $new-sidebar-width: 220px;
padding
:
10px
16px
10px
10px
;
color
:
$gl-text-color
;
.avatar-container
{
flex
:
0
0
40px
;
background-color
:
$white-light
;
@media
(
max-width
:
$screen-xs-max
)
{
padding-right
:
30px
;
}
&
:hover
{
...
...
@@ -55,12 +57,44 @@ $new-sidebar-width: 220px;
}
}
}
}
.avatar-container
{
flex
:
0
0
40px
;
background-color
:
$white-light
;
}
.project-title
,
.group-title
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
&
:hover
{
.close-nav-button
{
color
:
$white-light
;
}
}
.close-nav-button
{
display
:
none
;
position
:
absolute
;
top
:
0
;
right
:
0
;
height
:
100%
;
background-color
:
transparent
;
border
:
0
;
padding
:
0
10px
;
@media
(
max-width
:
$screen-xs-max
)
{
display
:
block
;
}
&
:hover
{
color
:
$gl-text-color
;
}
}
}
.settings-avatar
{
...
...
@@ -89,6 +123,10 @@ $new-sidebar-width: 220px;
background-color
:
$gray-normal
;
box-shadow
:
inset
-2px
0
0
$border-color
;
&
.nav-sidebar-expanded
{
width
:
$new-sidebar-width
;
}
a
{
text-decoration
:
none
;
}
...
...
@@ -185,6 +223,25 @@ $new-sidebar-width: 220px;
}
}
.toggle-mobile-nav
{
display
:
none
;
background-color
:
transparent
;
border
:
0
;
padding
:
6px
16px
;
margin
:
0
16px
0
-15px
;
height
:
46px
;
border-right
:
1px
solid
$gl-text-color-quaternary
;
i
{
font-size
:
20px
;
color
:
$gl-text-color-secondary
;
}
@media
(
max-width
:
$screen-xs-max
)
{
display
:
inline-block
;
}
}
// Make issue boards full-height now that sub-nav is gone
...
...
This diff is collapsed.
Click to expand it.
app/views/layouts/nav/_breadcrumbs.html.haml
View file @
cb83c50d
...
...
@@ -3,6 +3,8 @@
%nav
.breadcrumbs
{
role:
"navigation"
}
.breadcrumbs-container
{
class:
[
container_class
,
@content_class
]
}
%button
.toggle-mobile-nav
=
icon
(
'bars'
)
.breadcrumbs-links.js-title-container
-
unless
hide_top_links
.title
...
...
This diff is collapsed.
Click to expand it.
app/views/layouts/nav/_new_project_sidebar.html.haml
View file @
cb83c50d
.nav-sidebar
-
can_edit
=
can?
(
current_user
,
:admin_project
,
@project
)
=
link_to
project_path
(
@project
),
title:
@project
.
name
,
class:
'context-header'
do
.context-header
=
link_to
project_path
(
@project
),
title:
@project
.
name
do
.avatar-container.s40.project-avatar
=
project_icon
(
@project
,
alt:
@project
.
name
,
class:
'avatar s40 avatar-tile'
)
.project-title
=
@project
.
name
%button
.close-nav-button
=
icon
(
'times'
)
%ul
.sidebar-top-level-items
=
nav_link
(
path:
[
'projects#show'
,
'projects#activity'
,
'cycle_analytics#show'
],
html_options:
{
class:
'home'
})
do
=
link_to
project_path
(
@project
),
title:
'Project'
,
class:
'shortcuts-project'
do
...
...
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