diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-15 16:02:10 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-15 16:02:10 +0100 |
commit | b6811c060a2620757bcc75a2a85b430b95ef2532 (patch) | |
tree | 6d27f9120bb4b6d14896286323f8616d8ffde0df /app | |
parent | 4a2a6d521a260981482ee8e4931ebf06cb4f5b6a (diff) | |
download | gitlab-ce-b6811c060a2620757bcc75a2a85b430b95ef2532.tar.gz |
Fixes icon sidebar expanding causing a jump in paddingicon-sidebar-expanded-margin
Closes #36456
Diffstat (limited to 'app')
-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); } |