Commit 9afab296 authored by Jacob Schatz's avatar Jacob Schatz

Only save right sidebar position cookie if user did the collapsing.

parent 8835514b
...@@ -225,8 +225,8 @@ $ -> ...@@ -225,8 +225,8 @@ $ ->
$gutterIcon.closest('a').trigger('click') $gutterIcon.closest('a').trigger('click')
$(document) $(document)
.off 'click', '.gutter-toggle' .off 'click', 'aside .gutter-toggle'
.on 'click', '.gutter-toggle', (e) -> .on 'click', 'aside .gutter-toggle', (e, manual) ->
e.preventDefault() e.preventDefault()
$this = $(this) $this = $(this)
$thisIcon = $this.find 'i' $thisIcon = $this.find 'i'
...@@ -251,9 +251,10 @@ $ -> ...@@ -251,9 +251,10 @@ $ ->
$('.page-with-sidebar') $('.page-with-sidebar')
.removeClass('right-sidebar-collapsed') .removeClass('right-sidebar-collapsed')
.addClass('right-sidebar-expanded') .addClass('right-sidebar-expanded')
$.cookie("collapsed_gutter", if not manual
$('.right-sidebar') $.cookie("collapsed_gutter",
.hasClass('right-sidebar-collapsed'), { path: '/' }) $('.right-sidebar')
.hasClass('right-sidebar-collapsed'), { path: '/' })
bootstrapBreakpoint = undefined; bootstrapBreakpoint = undefined;
checkBootstrapBreakpoints = -> checkBootstrapBreakpoints = ->
......
...@@ -195,6 +195,6 @@ class @MergeRequestTabs ...@@ -195,6 +195,6 @@ class @MergeRequestTabs
setTimeout( -> setTimeout( ->
# Only when sidebar is collapsed # Only when sidebar is collapsed
if $gutterIcon.is('.fa-angle-double-right') if $gutterIcon.is('.fa-angle-double-right')
$gutterIcon.closest('a').trigger('click') $gutterIcon.closest('a').trigger('click',[true])
, 0) , 0)
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