diff options
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 4ffd71d9de5..5a9b3d19f84 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -1,13 +1,12 @@ /* eslint-disable no-new, class-methods-use-this */ -/* global Breakpoints */ /* global Flash */ /* global notes */ import Cookies from 'js-cookie'; -import './breakpoints'; import './flash'; import BlobForkSuggestion from './blob/blob_fork_suggestion'; -import stickyMonitor from './lib/utils/sticky'; +import initChangesDropdown from './init_changes_dropdown'; +import bp from './breakpoints'; /* eslint-disable max-len */ // MergeRequestTabs @@ -134,7 +133,7 @@ import stickyMonitor from './lib/utils/sticky'; this.destroyPipelinesView(); } else if (this.isDiffAction(action)) { this.loadDiff($target.attr('href')); - if (Breakpoints.get().getBreakpointSize() !== 'lg') { + if (bp.getBreakpointSize() !== 'lg') { this.shrinkView(); } if (this.diffViewType() === 'parallel') { @@ -145,7 +144,7 @@ import stickyMonitor from './lib/utils/sticky'; this.resetViewContainer(); this.mountPipelinesView(); } else { - if (Breakpoints.get().getBreakpointSize() !== 'xs') { + if (bp.getBreakpointSize() !== 'xs') { this.expandView(); } this.resetViewContainer(); @@ -267,9 +266,7 @@ import stickyMonitor from './lib/utils/sticky'; const $container = $('#diffs'); $container.html(data.html); - this.initChangesDropdown(); - - stickyMonitor(document.querySelector('.js-diff-files-changed')); + initChangesDropdown(); if (typeof gl.diffNotesCompileComponents !== 'undefined') { gl.diffNotesCompileComponents(); @@ -319,13 +316,6 @@ import stickyMonitor from './lib/utils/sticky'; }); } - initChangesDropdown() { - $('.js-diff-stats-dropdown').glDropdown({ - filterable: true, - remoteFilter: false, - }); - } - // Show or hide the loading spinner // // status - Boolean, true to show, false to hide @@ -401,7 +391,7 @@ import stickyMonitor from './lib/utils/sticky'; // Screen space on small screens is usually very sparse // So we dont affix the tabs on these - if (Breakpoints.get().getBreakpointSize() === 'xs' || !$tabs.length) return; + if (bp.getBreakpointSize() === 'xs' || !$tabs.length) return; /** If the browser does not support position sticky, it returns the position as static. |