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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
729cb3b3
Commit
729cb3b3
authored
Oct 03, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes sidebar navigation.
parent
71345998
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
app/assets/javascripts/sidebar.js.es6
app/assets/javascripts/sidebar.js.es6
+5
-7
app/assets/stylesheets/framework/sidebar.scss
app/assets/stylesheets/framework/sidebar.scss
+1
-0
app/views/layouts/_page.html.haml
app/views/layouts/_page.html.haml
+3
-2
No files found.
app/assets/javascripts/sidebar.js.es6
View file @
729cb3b3
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
$(pageSelector).hasClass(expandedPageClass)
$(pageSelector).hasClass(expandedPageClass)
);
);
$(document)
$(document)
.on('click', sidebarToggleSelector, (
e) => this.toggleSidebar(e
))
.on('click', sidebarToggleSelector, (
) => this.toggleSidebar(
))
.on('click', pinnedToggleSelector, (
e) => this.togglePinnedState(e
))
.on('click', pinnedToggleSelector, (
) => this.togglePinnedState(
))
.on('click', 'html, body', (e) => this.handleClickEvent(e))
.on('click', 'html, body', (e) => this.handleClickEvent(e))
.on('page:change', () => this.renderState());
.on('page:change', () => this.renderState());
this.renderState();
this.renderState();
...
@@ -47,19 +47,17 @@
...
@@ -47,19 +47,17 @@
const targetIsToggle = $target.closest(sidebarToggleSelector).length > 0;
const targetIsToggle = $target.closest(sidebarToggleSelector).length > 0;
const targetIsSidebar = $target.closest(sidebarWrapperSelector).length > 0;
const targetIsSidebar = $target.closest(sidebarWrapperSelector).length > 0;
if (!targetIsToggle && (!targetIsSidebar || $target.closest('a'))) {
if (!targetIsToggle && (!targetIsSidebar || $target.closest('a'))) {
this.toggleSidebar(
e
);
this.toggleSidebar();
}
}
}
}
}
}
toggleSidebar(e) {
toggleSidebar() {
e.preventDefault();
this.isExpanded = !this.isExpanded;
this.isExpanded = !this.isExpanded;
this.renderState();
this.renderState();
}
}
togglePinnedState(e) {
togglePinnedState() {
e.preventDefault();
this.isPinned = !this.isPinned;
this.isPinned = !this.isPinned;
if (!this.isPinned) {
if (!this.isPinned) {
this.isExpanded = false;
this.isExpanded = false;
...
...
app/assets/stylesheets/framework/sidebar.scss
View file @
729cb3b3
...
@@ -142,6 +142,7 @@
...
@@ -142,6 +142,7 @@
transition-duration
:
.3s
;
transition-duration
:
.3s
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
cursor
:
pointer
;
&
:hover
,
&
:hover
,
&
:focus
{
&
:focus
{
...
...
app/views/layouts/_page.html.haml
View file @
729cb3b3
.page-with-sidebar
{
class:
"#{page_sidebar_class} #{page_gutter_class}"
}
.page-with-sidebar
{
class:
"#{page_sidebar_class} #{page_gutter_class}"
}
.sidebar-wrapper.nicescroll
.sidebar-wrapper.nicescroll
.sidebar-action-buttons
.sidebar-action-buttons
=
link_to
'#'
,
class:
'nav-header-btn toggle-nav-collapse'
,
title:
"Open/Close"
do
.nav-header-btn.toggle-nav-collapse
{
title:
"Open/Close"
}
%span
.sr-only
Toggle navigation
%span
.sr-only
Toggle navigation
=
icon
(
'bars'
)
=
icon
(
'bars'
)
=
link_to
'#'
,
class:
"nav-header-btn pin-nav-btn has-tooltip
#{
'is-active'
if
pinned_nav?
}
js-nav-pin"
,
title:
pinned_nav?
?
"Unpin navigation"
:
"Pin Navigation"
,
data:
{
placement:
'right'
,
container:
'body'
}
do
%div
{
class:
"nav-header-btn pin-nav-btn has-tooltip #{'is-active' if pinned_nav?} js-nav-pin"
,
title:
pinned_nav?
?
"Unpin navigation"
:
"Pin Navigation"
,
data:
{
placement:
'right'
,
container:
'body'
}
}
%span
.sr-only
Toggle navigation pinning
%span
.sr-only
Toggle navigation pinning
=
icon
(
'fw thumb-tack'
)
=
icon
(
'fw thumb-tack'
)
...
...
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