Commit cabd228f authored by Jacob Schatz's avatar Jacob Schatz

Fix bugs with open and close buttons

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