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
{
export
default
class
NewNavSidebar
{
constructor
()
{
constructor
()
{
this
.
initDomElements
();
this
.
initDomElements
();
...
@@ -8,6 +6,7 @@ export default class NewNavSidebar {
...
@@ -8,6 +6,7 @@ export default class NewNavSidebar {
initDomElements
()
{
initDomElements
()
{
this
.
$sidebar
=
$
(
'
.nav-sidebar
'
);
this
.
$sidebar
=
$
(
'
.nav-sidebar
'
);
this
.
$overlay
=
$
(
'
.mobile-overlay
'
);
this
.
$openSidebar
=
$
(
'
.toggle-mobile-nav
'
);
this
.
$openSidebar
=
$
(
'
.toggle-mobile-nav
'
);
this
.
$closeSidebar
=
$
(
'
.close-nav-button
'
);
this
.
$closeSidebar
=
$
(
'
.close-nav-button
'
);
}
}
...
@@ -15,9 +14,11 @@ export default class NewNavSidebar {
...
@@ -15,9 +14,11 @@ export default class NewNavSidebar {
bindEvents
()
{
bindEvents
()
{
this
.
$openSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
true
));
this
.
$openSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
true
));
this
.
$closeSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
false
));
this
.
$closeSidebar
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
false
));
this
.
$overlay
.
on
(
'
click
'
,
e
=>
this
.
toggleSidebarNav
(
e
,
false
));
}
}
toggleSidebarNav
(
show
)
{
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;
...
@@ -115,7 +115,7 @@ $new-sidebar-width: 220px;
position
:
fixed
;
position
:
fixed
;
z-index
:
400
;
z-index
:
400
;
width
:
$new-sidebar-width
;
width
:
$new-sidebar-width
;
transition
:
width
$sidebar-transition-duration
;
transition
:
left
$sidebar-transition-duration
;
top
:
50px
;
top
:
50px
;
bottom
:
0
;
bottom
:
0
;
left
:
0
;
left
:
0
;
...
@@ -124,7 +124,7 @@ $new-sidebar-width: 220px;
...
@@ -124,7 +124,7 @@ $new-sidebar-width: 220px;
box-shadow
:
inset
-2px
0
0
$border-color
;
box-shadow
:
inset
-2px
0
0
$border-color
;
&
.nav-sidebar-expanded
{
&
.nav-sidebar-expanded
{
width
:
$new-sidebar-width
;
left
:
0
;
}
}
a
{
a
{
...
@@ -156,7 +156,7 @@ $new-sidebar-width: 220px;
...
@@ -156,7 +156,7 @@ $new-sidebar-width: 220px;
}
}
@media
(
max-width
:
$screen-xs-max
)
{
@media
(
max-width
:
$screen-xs-max
)
{
width
:
0
;
left
:
(
-
$new-sidebar-width
)
;
}
}
}
}
...
@@ -242,6 +242,19 @@ $new-sidebar-width: 220px;
...
@@ -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
// Make issue boards full-height now that sub-nav is gone
...
...
app/views/layouts/_page.html.haml
View file @
b4b5ad39
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
-
if
content_for?
(
:sub_nav
)
-
if
content_for?
(
:sub_nav
)
=
yield
:sub_nav
=
yield
:sub_nav
.content-wrapper
{
class:
"#{(layout_nav_class unless show_new_nav?)}"
}
.content-wrapper
{
class:
"#{(layout_nav_class unless show_new_nav?)}"
}
-
if
show_new_nav?
.mobile-overlay
.alert-wrapper
.alert-wrapper
=
render
"layouts/broadcast"
=
render
"layouts/broadcast"
-
if
show_new_nav?
-
if
show_new_nav?
...
...
app/views/layouts/nav/_breadcrumbs.html.haml
View file @
b4b5ad39
...
@@ -3,8 +3,9 @@
...
@@ -3,8 +3,9 @@
%nav
.breadcrumbs
{
role:
"navigation"
}
%nav
.breadcrumbs
{
role:
"navigation"
}
.breadcrumbs-container
{
class:
[
container_class
,
@content_class
]
}
.breadcrumbs-container
{
class:
[
container_class
,
@content_class
]
}
%button
.toggle-mobile-nav
-
if
defined?
(
@new_sidebar
)
=
icon
(
'bars'
)
%button
.toggle-mobile-nav
=
icon
(
'bars'
)
.breadcrumbs-links.js-title-container
.breadcrumbs-links.js-title-container
-
unless
hide_top_links
-
unless
hide_top_links
.title
.title
...
...
app/views/layouts/nav/_new_admin_sidebar.html.haml
View file @
b4b5ad39
.nav-sidebar
.nav-sidebar
=
link_to
admin_root_path
,
title:
'Admin Overview'
,
class:
'context-header'
do
.context-header
.avatar-container.s40.settings-avatar
=
link_to
admin_root_path
,
title:
'Admin Overview'
do
=
icon
(
'wrench'
)
.avatar-container.s40.settings-avatar
.project-title
Admin Area
=
icon
(
'wrench'
)
.project-title
Admin Area
%button
.close-nav-button
=
icon
(
'times'
)
%ul
.sidebar-top-level-items
%ul
.sidebar-top-level-items
=
nav_link
(
controller:
%w(dashboard admin projects users groups jobs runners cohorts)
,
html_options:
{
class:
'home'
})
do
=
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
=
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
.nav-sidebar
=
link_to
group_path
(
@group
),
title:
@group
.
name
,
class:
'context-header'
do
.context-header
.avatar-container.s40.group-avatar
=
link_to
group_path
(
@group
),
title:
@group
.
name
do
=
image_tag
group_icon
(
@group
),
class:
"avatar s40 avatar-tile"
.avatar-container.s40.group-avatar
.group-title
=
image_tag
group_icon
(
@group
),
class:
"avatar s40 avatar-tile"
=
@group
.
name
.group-title
=
@group
.
name
%button
.close-nav-button
=
icon
(
'times'
)
%ul
.sidebar-top-level-items
%ul
.sidebar-top-level-items
=
nav_link
(
path:
[
'groups#show'
,
'groups#activity'
,
'groups#subgroups'
],
html_options:
{
class:
'home'
})
do
=
nav_link
(
path:
[
'groups#show'
,
'groups#activity'
,
'groups#subgroups'
],
html_options:
{
class:
'home'
})
do
=
link_to
group_path
(
@group
),
title:
'Home'
do
=
link_to
group_path
(
@group
),
title:
'Home'
do
...
...
app/views/layouts/nav/_new_profile_sidebar.html.haml
View file @
b4b5ad39
.nav-sidebar
.nav-sidebar
=
link_to
profile_path
,
title:
'Profile Settings'
,
class:
'context-header'
do
.context-header
.avatar-container.s40.settings-avatar
=
link_to
profile_path
,
title:
'Profile Settings'
do
=
icon
(
'user'
)
.avatar-container.s40.settings-avatar
.project-title
User Settings
=
icon
(
'user'
)
.project-title
User Settings
%button
.close-nav-button
=
icon
(
'times'
)
%ul
.sidebar-top-level-items
%ul
.sidebar-top-level-items
=
nav_link
(
path:
'profiles#show'
,
html_options:
{
class:
'home'
})
do
=
nav_link
(
path:
'profiles#show'
,
html_options:
{
class:
'home'
})
do
=
link_to
profile_path
,
title:
'Profile Settings'
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