Commit cabd228f authored by Jacob Schatz's avatar Jacob Schatz

Fix bugs with open and close buttons

parent 61ce134f
......@@ -220,7 +220,7 @@ $ ->
.off 'breakpoint:change'
.on 'breakpoint:change', (e, breakpoint) ->
if breakpoint is 'sm' or breakpoint is 'xs'
$gutterIcon = $('.gutter-toggle').find('i')
$gutterIcon = $('aside .gutter-toggle').find('i')
if $gutterIcon.hasClass('fa-angle-double-right')
$gutterIcon.closest('a').trigger('click')
......@@ -230,36 +230,22 @@ $ ->
e.preventDefault()
$this = $(this)
$thisIcon = $this.find 'i'
$allGutterToggleIcons = $('.gutter-toggle i')
if $thisIcon.hasClass('fa-angle-double-right')
# It's open -> close it
if bootstrapBreakpoint is 'xs'
# it's the gutter open button outside the aside
if not $this.closest('aside').length
$('aside').addClass('hidden-xs')
console.log(bootstrapBreakpoint);
$thisIcon
$allGutterToggleIcons
.removeClass('fa-angle-double-right')
.addClass('fa-angle-double-left')
$this
.closest('aside')
$('aside.right-sidebar')
.removeClass('right-sidebar-expanded')
.addClass('right-sidebar-collapsed')
$('.page-with-sidebar')
.removeClass('right-sidebar-expanded')
.addClass('right-sidebar-collapsed')
else
# It's closed -> open it
if bootstrapBreakpoint is 'xs'
# it's the gutter open button outside the aside
if not $this.closest('aside').length
$('aside').removeClass('hidden-xs')
$thisIcon
$allGutterToggleIcons
.removeClass('fa-angle-double-left')
.addClass('fa-angle-double-right')
$this
.closest('aside')
$('aside.right-sidebar')
.removeClass('right-sidebar-collapsed')
.addClass('right-sidebar-expanded')
$('.page-with-sidebar')
......
......@@ -151,7 +151,6 @@
}
}
.right-sidebar {
position: fixed;
top: 58px;
......@@ -174,6 +173,12 @@
.gutter-toggle {
border-left: 1px solid $border-gray-light;
@media (max-width: $screen-sm-max) {
display: none;
}
@media (min-width: $screen-sm-min) {
display: block
}
}
}
......@@ -184,6 +189,14 @@
}
&.right-sidebar-collapsed {
@media (max-width: $screen-sm-max) {
display: none;
}
@media (min-width: $screen-sm-min) {
display: block
}
width: $sidebar_collapsed_width;
padding-top: 0;
......@@ -247,6 +260,10 @@
}
}
.btn-default.gutter-toggle {
margin-top: 4px;
}
.detail-page-description {
small {
color: $gray-darkest;
......
......@@ -5,7 +5,7 @@ module IssuablesHelper
end
def sidebar_gutter_collapsed_class
"hidden-xs right-sidebar-#{sidebar_gutter_collapsed? ? 'collapsed' : 'expanded'}"
"right-sidebar-#{sidebar_gutter_collapsed? ? 'collapsed' : 'expanded'}"
end
def issuables_count(issuable)
......
......@@ -4,6 +4,8 @@
= @merge_request.state_human_name
%span.hidden-sm.hidden-md.hidden-lg
=icon(@merge_request.state_icon_name)
%a.btn.btn-default.pull-right.hidden-sm.hidden-md.hidden-lg.gutter-toggle{ href: "#" }
=icon('angle-double-left')
.issue-meta
%strong.identifier
Merge Request ##{@merge_request.iid}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment