Move performance_bar setup to dispatcher to main.js
This commit is contained in:
parent
05f403cf04
commit
2aa29872a6
2 changed files with 2 additions and 8 deletions
|
@ -4,7 +4,6 @@ import $ from 'jquery';
|
|||
import GfmAutoComplete from './gfm_auto_complete';
|
||||
import { convertPermissionToBoolean } from './lib/utils/common_utils';
|
||||
import Shortcuts from './shortcuts';
|
||||
import performanceBar from './performance_bar';
|
||||
|
||||
function initPageShortcuts(page) {
|
||||
const pagesWithCustomShortcuts = [
|
||||
|
@ -55,17 +54,10 @@ function initGFMInput() {
|
|||
});
|
||||
}
|
||||
|
||||
function initPerformanceBar() {
|
||||
if (document.querySelector('#js-peek')) {
|
||||
performanceBar({ container: '#js-peek' });
|
||||
}
|
||||
}
|
||||
|
||||
export default () => {
|
||||
const page = $('body').attr('data-page');
|
||||
if (page) {
|
||||
initPageShortcuts(page);
|
||||
initGFMInput();
|
||||
initPerformanceBar();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -28,6 +28,7 @@ import './frequent_items';
|
|||
import initBreadcrumbs from './breadcrumb';
|
||||
import initDispatcher from './dispatcher';
|
||||
import initUsagePingConsent from './usage_ping_consent';
|
||||
import initPerformanceBar from './performance_bar';
|
||||
import initSearchAutocomplete from './search_autocomplete';
|
||||
import GlFieldErrors from './gl_field_errors';
|
||||
|
||||
|
@ -80,6 +81,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
initUsagePingConsent();
|
||||
|
||||
if (document.querySelector('.search')) initSearchAutocomplete();
|
||||
if (document.querySelector('#js-peek')) initPerformanceBar({ container: '#js-peek' });
|
||||
|
||||
// Set the default path for all cookies to GitLab's root directory
|
||||
Cookies.defaults.path = gon.relative_url_root || '/';
|
||||
|
|
Loading…
Reference in a new issue