Move performance_bar setup to dispatcher to main.js

This commit is contained in:
Mike Greiling 2018-09-13 17:05:10 -05:00
parent 05f403cf04
commit 2aa29872a6
No known key found for this signature in database
GPG key ID: 0303DF507FA67596
2 changed files with 2 additions and 8 deletions

View file

@ -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();
}
};

View file

@ -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 || '/';