Commit 505c04c7 authored by Jannik Lehmann's avatar Jannik Lehmann

Remove DOMContentLoaded Eventlisteners

Removing DOMContentLoaded Eventlisteners from
index files since the scripts
are embedded using the defer tag.
parent 5fa9332d
import CiTemplate from './ci_template';
document.addEventListener('DOMContentLoaded', () => new CiTemplate());
// eslint-disable-next-line no-new
new CiTemplate();
......@@ -38,13 +38,12 @@ const getDropdownConfig = (placeholder, apiPath, textProp) => ({
},
});
document.addEventListener('DOMContentLoaded', () => {
groupsSelect();
groupsSelect();
// ElasticSearch
const $container = $('#js-elasticsearch-settings');
// ElasticSearch
const $container = $('#js-elasticsearch-settings');
$container
$container
.find('.js-limit-checkbox')
.on('change', e =>
onLimitCheckboxChange(
......@@ -54,7 +53,7 @@ document.addEventListener('DOMContentLoaded', () => {
),
);
$container
$container
.find('.js-elasticsearch-namespaces')
.select2(
getDropdownConfig(
......@@ -64,7 +63,7 @@ document.addEventListener('DOMContentLoaded', () => {
),
);
$container
$container
.find('.js-elasticsearch-projects')
.select2(
getDropdownConfig(
......@@ -73,4 +72,3 @@ document.addEventListener('DOMContentLoaded', () => {
'name_with_namespace',
),
);
});
......@@ -36,14 +36,13 @@ const getDropdownConfig = (placeholder, url) => ({
},
});
document.addEventListener('DOMContentLoaded', () => {
const callout = document.querySelector('.js-admin-integrations-moved');
PersistentUserCallout.factory(callout);
const callout = document.querySelector('.js-admin-integrations-moved');
PersistentUserCallout.factory(callout);
// ElasticSearch
const $container = $('#js-elasticsearch-settings');
// ElasticSearch
const $container = $('#js-elasticsearch-settings');
$container
$container
.find('.js-limit-checkbox')
.on('change', e =>
onLimitCheckboxChange(
......@@ -53,7 +52,7 @@ document.addEventListener('DOMContentLoaded', () => {
),
);
$container
$container
.find('.js-elasticsearch-namespaces')
.select2(
getDropdownConfig(
......@@ -62,7 +61,7 @@ document.addEventListener('DOMContentLoaded', () => {
),
);
$container
$container
.find('.js-elasticsearch-projects')
.select2(
getDropdownConfig(
......@@ -70,4 +69,3 @@ document.addEventListener('DOMContentLoaded', () => {
'/-/autocomplete/project_routes.json',
),
);
});
import AdminEmailSelect from './admin_email_select';
document.addEventListener('DOMContentLoaded', () => {
AdminEmailSelect();
});
AdminEmailSelect();
import initGeoSettingsForm from 'ee/geo_settings';
document.addEventListener('DOMContentLoaded', initGeoSettingsForm);
initGeoSettingsForm();
import { initEpicForm } from 'ee/epic/new_epic_bundle';
document.addEventListener('DOMContentLoaded', () => {
initEpicForm();
});
initEpicForm();
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