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