diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-06 12:07:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-06 12:07:42 +0300 |
commit | 669c24d9276db9a73bbcea40aeab98273aae9e5e (patch) | |
tree | 9548cfccd841b4aae3703cdd1b5bf5c167d5a8dc /app/assets/javascripts/main.js | |
parent | 13076511c60f62ce0f8baba22ca9b94755a7d3cb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/main.js')
-rw-r--r-- | app/assets/javascripts/main.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 8373ddd7a43..e73e2c943d2 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -19,7 +19,7 @@ import { getLocationHash, visitUrl } from './lib/utils/url_utility'; // everything else import loadAwardsHandler from './awards_handler'; -import bp from './breakpoints'; +import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import Flash, { removeFlashClickListener } from './flash'; import './gl_dropdown'; import initTodoToggle from './header'; @@ -185,7 +185,7 @@ document.addEventListener('DOMContentLoaded', () => { } }); - if (bootstrapBreakpoint === 'xs') { + if (bootstrapBreakpoint === 'sm' || bootstrapBreakpoint === 'xs') { const $rightSidebar = $('aside.right-sidebar, .layout-page'); $rightSidebar.removeClass('right-sidebar-expanded').addClass('right-sidebar-collapsed'); @@ -270,7 +270,8 @@ document.addEventListener('DOMContentLoaded', () => { }); $document.on('breakpoint:change', (e, breakpoint) => { - if (breakpoint === 'sm' || breakpoint === 'xs') { + const breakpointSizes = ['md', 'sm', 'xs']; + if (breakpointSizes.includes(breakpoint)) { const $gutterIcon = $sidebarGutterToggle.find('i'); if ($gutterIcon.hasClass('fa-angle-double-right')) { $sidebarGutterToggle.trigger('click'); |