Commit 16f05230 authored by Jacob Schatz's avatar Jacob Schatz

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
parents fb1a7553 21f55249
......@@ -218,13 +218,20 @@ $ ->
$this = $(this)
$this.attr 'value', $this.val()
$sidebarGutterToggle = $('.js-sidebar-toggle')
$navIconToggle = $('.toggle-nav-collapse')
$(document)
.off 'breakpoint:change'
.on 'breakpoint:change', (e, breakpoint) ->
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')
$gutterIcon.closest('a').trigger('click')
$sidebarGutterToggle.trigger('click')
$navIcon = $navIconToggle.find('.fa')
if $navIcon.hasClass('fa-angle-left')
$navIconToggle.trigger('click')
$(document)
.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