summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2016-03-22 20:31:15 +0000
committerJacob Schatz <jschatz1@gmail.com>2016-03-22 20:31:15 +0000
commit16f05230a6daa569ff33c36b9e0850ad7a17e4d2 (patch)
tree5ebcd2c464f37b40beb501222b2eae80805ffadd
parentfb1a7553c7b22c8541caa0a6a3f0b49cd20dcf4a (diff)
parent21f5524926c3d3ac750ab1bb3781d320cd3e6cca (diff)
downloadgitlab-ce-16f05230a6daa569ff33c36b9e0850ad7a17e4d2.tar.gz
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
-rw-r--r--app/assets/javascripts/application.js.coffee11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 01451830653..3c83450ce18 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -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'