Commit 0223a2de authored by Jacob Schatz's avatar Jacob Schatz Committed by Rémy Coutable

Merge branch 'auto-collapse-nav' into 'master'

Auto collapses the navigation when resizing

Closes #14475

![auto-collapse](/uploads/332c6261acb6bc30d7d30cbdfafe92eb/auto-collapse.gif)

See merge request !3343
parent 5a20d3ab
...@@ -4,6 +4,7 @@ v 8.6.1 (unreleased) ...@@ -4,6 +4,7 @@ v 8.6.1 (unreleased)
- Add option to reload the schema before restoring a database backup. !2807 - Add option to reload the schema before restoring a database backup. !2807
- Restrict notifications for confidential issues. !3334 - Restrict notifications for confidential issues. !3334
- Fixes issue with signin button overflowing on mobile. !3342 - Fixes issue with signin button overflowing on mobile. !3342
- Auto collapses the navigation sidebar when resizing. !3343
v 8.6.0 v 8.6.0
- Add ability to move issue to another project - Add ability to move issue to another project
......
...@@ -218,13 +218,20 @@ $ -> ...@@ -218,13 +218,20 @@ $ ->
$this = $(this) $this = $(this)
$this.attr 'value', $this.val() $this.attr 'value', $this.val()
$sidebarGutterToggle = $('.js-sidebar-toggle')
$navIconToggle = $('.toggle-nav-collapse')
$(document) $(document)
.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 = $('.js-sidebar-toggle').find('i') $gutterIcon = $sidebarGutterToggle.find('i')
if $gutterIcon.hasClass('fa-angle-double-right') if $gutterIcon.hasClass('fa-angle-double-right')
$gutterIcon.closest('a').trigger('click') $sidebarGutterToggle.trigger('click')
$navIcon = $navIconToggle.find('.fa')
if $navIcon.hasClass('fa-angle-left')
$navIconToggle.trigger('click')
$(document) $(document)
.off 'click', '.js-sidebar-toggle' .off 'click', '.js-sidebar-toggle'
......
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