diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2017-08-16 14:58:37 +0000 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-08-16 12:28:23 -0500 |
commit | df9729d32d4f2f65de859b0d47ae563da198872c (patch) | |
tree | a322889458fad59235745c2494081fa551780509 | |
parent | 93eff0097dc7c3949b9eeeb0dcb04ca04c82baa1 (diff) | |
download | gitlab-ce-df9729d32d4f2f65de859b0d47ae563da198872c.tar.gz |
Merge branch 'icon-sidebar-expanded-margin' into 'master'
Fixes icon sidebar expanding causing a jump in padding
Closes #36456
See merge request !13568
-rw-r--r-- | app/assets/javascripts/new_sidebar.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/new_sidebar.js b/app/assets/javascripts/new_sidebar.js index b10b074f5ac..2d1ed9e4076 100644 --- a/app/assets/javascripts/new_sidebar.js +++ b/app/assets/javascripts/new_sidebar.js @@ -43,10 +43,12 @@ export default class NewNavSidebar { } toggleCollapsedSidebar(collapsed) { - this.$sidebar.toggleClass('sidebar-icons-only', collapsed); + const breakpoint = bp.getBreakpointSize(); + if (this.$sidebar.length) { + this.$sidebar.toggleClass('sidebar-icons-only', collapsed); this.$page.toggleClass('page-with-new-sidebar', !collapsed); - this.$page.toggleClass('page-with-icon-sidebar', collapsed); + this.$page.toggleClass('page-with-icon-sidebar', breakpoint === 'sm' ? true : collapsed); } NewNavSidebar.setCollapsedCookie(collapsed); } |