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