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
Jérome Perrin
gitlab-ce
Commits
b4b5ad39
Commit
b4b5ad39
authored
Jul 18, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sidebar accessible on mobile
parent
cb83c50d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
21 deletions
+47
-21
app/assets/javascripts/new_sidebar.js
app/assets/javascripts/new_sidebar.js
+4
-3
app/assets/stylesheets/new_sidebar.scss
app/assets/stylesheets/new_sidebar.scss
+16
-3
app/views/layouts/_page.html.haml
app/views/layouts/_page.html.haml
+2
-0
app/views/layouts/nav/_breadcrumbs.html.haml
app/views/layouts/nav/_breadcrumbs.html.haml
+3
-2
app/views/layouts/nav/_new_admin_sidebar.html.haml
app/views/layouts/nav/_new_admin_sidebar.html.haml
+7
-4
app/views/layouts/nav/_new_group_sidebar.html.haml
app/views/layouts/nav/_new_group_sidebar.html.haml
+8
-5
app/views/layouts/nav/_new_profile_sidebar.html.haml
app/views/layouts/nav/_new_profile_sidebar.html.haml
+7
-4
No files found.
app/assets/javascripts/new_sidebar.js
View file @
b4b5ad39
const
SIDEBAR_EXPANDED_CLASS
=
'
nav-sidebar-expanded
'
;
export
default
class
NewNavSidebar
{
constructor
()
{
this
.
initDomElements
();
...
...
@@ -8,6 +6,7 @@ export default class NewNavSidebar {
initDomElements
()
{
this
.
$sidebar
=
$
(
'
.nav-sidebar
'
);
this
.
$overlay
=
$
(
'
.mobile-overlay
'
);
this
.
$openSidebar
=
$
(
'
.toggle-mobile-nav
'
);
this
.
$closeSidebar
=
$
(
'
.close-nav-button
'
);
}
...
...
@@ -15,9 +14,11 @@ export default class NewNavSidebar {
bindEvents
()
{
this
.
$openSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
true
));
this
.
$closeSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
false
));
this
.
$overlay
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
false
));
}
toggleSidebarNav
(
show
)
{
this
.
$sidebar
.
toggleClass
(
SIDEBAR_EXPANDED_CLASS
,
show
);
this
.
$sidebar
.
toggleClass
(
'
nav-sidebar-expanded
'
,
show
);
this
.
$overlay
.
toggleClass
(
'
mobile-nav-open
'
,
show
);
}
}
app/assets/stylesheets/new_sidebar.scss
View file @
b4b5ad39
...
...
@@ -115,7 +115,7 @@ $new-sidebar-width: 220px;
position
:
fixed
;
z-index
:
400
;
width
:
$new-sidebar-width
;
transition
:
width
$sidebar-transition-duration
;
transition
:
left
$sidebar-transition-duration
;
top
:
50px
;
bottom
:
0
;
left
:
0
;
...
...
@@ -124,7 +124,7 @@ $new-sidebar-width: 220px;
box-shadow
:
inset
-2px
0
0
$border-color
;
&
.nav-sidebar-expanded
{
width
:
$new-sidebar-width
;
left
:
0
;
}
a
{
...
...
@@ -156,7 +156,7 @@ $new-sidebar-width: 220px;
}
@media
(
max-width
:
$screen-xs-max
)
{
width
:
0
;
left
:
(
-
$new-sidebar-width
)
;
}
}
...
...
@@ -242,6 +242,19 @@ $new-sidebar-width: 220px;
}
}
.mobile-overlay
{
display
:
none
;
&
.mobile-nav-open
{
display
:
block
;
position
:
absolute
;
background-color
:
$black-transparent
;
height
:
100%
;
width
:
100%
;
z-index
:
300
;
}
}
// Make issue boards full-height now that sub-nav is gone
...
...
app/views/layouts/_page.html.haml
View file @
b4b5ad39
...
...
@@ -10,6 +10,8 @@
-
if
content_for?
(
:sub_nav
)
=
yield
:sub_nav
.content-wrapper
{
class:
"#{(layout_nav_class unless show_new_nav?)}"
}
-
if
show_new_nav?
.mobile-overlay
.alert-wrapper
=
render
"layouts/broadcast"
-
if
show_new_nav?
...
...
app/views/layouts/nav/_breadcrumbs.html.haml
View file @
b4b5ad39
...
...
@@ -3,8 +3,9 @@
%nav
.breadcrumbs
{
role:
"navigation"
}
.breadcrumbs-container
{
class:
[
container_class
,
@content_class
]
}
%button
.toggle-mobile-nav
=
icon
(
'bars'
)
-
if
defined?
(
@new_sidebar
)
%button
.toggle-mobile-nav
=
icon
(
'bars'
)
.breadcrumbs-links.js-title-container
-
unless
hide_top_links
.title
...
...
app/views/layouts/nav/_new_admin_sidebar.html.haml
View file @
b4b5ad39
.nav-sidebar
=
link_to
admin_root_path
,
title:
'Admin Overview'
,
class:
'context-header'
do
.avatar-container.s40.settings-avatar
=
icon
(
'wrench'
)
.project-title
Admin Area
.context-header
=
link_to
admin_root_path
,
title:
'Admin Overview'
do
.avatar-container.s40.settings-avatar
=
icon
(
'wrench'
)
.project-title
Admin Area
%button
.close-nav-button
=
icon
(
'times'
)
%ul
.sidebar-top-level-items
=
nav_link
(
controller:
%w(dashboard admin projects users groups jobs runners cohorts)
,
html_options:
{
class:
'home'
})
do
=
link_to
admin_root_path
,
title:
'Overview'
,
class:
'shortcuts-tree'
do
...
...
app/views/layouts/nav/_new_group_sidebar.html.haml
View file @
b4b5ad39
.nav-sidebar
=
link_to
group_path
(
@group
),
title:
@group
.
name
,
class:
'context-header'
do
.avatar-container.s40.group-avatar
=
image_tag
group_icon
(
@group
),
class:
"avatar s40 avatar-tile"
.group-title
=
@group
.
name
.context-header
=
link_to
group_path
(
@group
),
title:
@group
.
name
do
.avatar-container.s40.group-avatar
=
image_tag
group_icon
(
@group
),
class:
"avatar s40 avatar-tile"
.group-title
=
@group
.
name
%button
.close-nav-button
=
icon
(
'times'
)
%ul
.sidebar-top-level-items
=
nav_link
(
path:
[
'groups#show'
,
'groups#activity'
,
'groups#subgroups'
],
html_options:
{
class:
'home'
})
do
=
link_to
group_path
(
@group
),
title:
'Home'
do
...
...
app/views/layouts/nav/_new_profile_sidebar.html.haml
View file @
b4b5ad39
.nav-sidebar
=
link_to
profile_path
,
title:
'Profile Settings'
,
class:
'context-header'
do
.avatar-container.s40.settings-avatar
=
icon
(
'user'
)
.project-title
User Settings
.context-header
=
link_to
profile_path
,
title:
'Profile Settings'
do
.avatar-container.s40.settings-avatar
=
icon
(
'user'
)
.project-title
User Settings
%button
.close-nav-button
=
icon
(
'times'
)
%ul
.sidebar-top-level-items
=
nav_link
(
path:
'profiles#show'
,
html_options:
{
class:
'home'
})
do
=
link_to
profile_path
,
title:
'Profile Settings'
do
...
...
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