Commit 4dca0710 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 initDependenciesApp from 'ee/dependencies';
document.addEventListener('DOMContentLoaded', initDependenciesApp);
initDependenciesApp();
import initSidebarBundle from 'ee/sidebar/sidebar_bundle';
import initMergeConflicts from '~/merge_conflicts/merge_conflicts_bundle';
document.addEventListener('DOMContentLoaded', () => {
initSidebarBundle();
initMergeConflicts();
});
initSidebarBundle();
initMergeConflicts();
......@@ -2,7 +2,6 @@ import '~/pages/projects/merge_requests/creations/new/index';
import UserCallout from '~/user_callout';
import initForm from '../../shared/init_form';
document.addEventListener('DOMContentLoaded', () => {
initForm();
return new UserCallout();
});
initForm();
// eslint-disable-next-line no-new
new UserCallout();
import '~/pages/projects/merge_requests/edit/index';
import initForm from '../shared/init_form';
document.addEventListener('DOMContentLoaded', initForm);
initForm();
import '~/pages/projects/show/index';
import initVueAlerts from '~/vue_alerts';
document.addEventListener('DOMContentLoaded', () => {
initVueAlerts();
});
initVueAlerts();
import $ from 'jquery';
document.addEventListener('DOMContentLoaded', () => {
const namespaceId = $('#namespace_id');
const newGroupName = $('#group_name');
const namespaceId = $('#namespace_id');
const newGroupName = $('#group_name');
namespaceId.on('change', () => {
namespaceId.on('change', () => {
const enableNewGroupName = namespaceId.val() === '0';
newGroupName
.toggleClass('hidden', !enableNewGroupName)
.find('input')
.prop('required', enableNewGroupName);
});
namespaceId.trigger('change');
});
namespaceId.trigger('change');
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