Commit 2aa29872 authored by Mike Greiling's avatar Mike Greiling

Move performance_bar setup to dispatcher to main.js

parent 05f403cf
......@@ -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 || '/';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment