Commit 79318ba9 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 3fb22f44
import initContributionAanalyticsCharts from 'ee/analytics/contribution_analytics/contribution_analytics_bundle';
import initGroupMemberContributions from 'ee/group_member_contributions';
document.addEventListener('DOMContentLoaded', () => {
const dataEl = document.getElementById('js-analytics-data');
if (dataEl) {
const dataEl = document.getElementById('js-analytics-data');
if (dataEl) {
initContributionAanalyticsCharts(dataEl);
initGroupMemberContributions();
}
});
}
......@@ -3,16 +3,14 @@ import initAccessRestrictionField from 'ee/groups/settings/access_restriction_fi
import validateRestrictedIpAddress from 'ee/groups/settings/access_restriction_field/validate_ip_address';
import { __ } from '~/locale';
document.addEventListener('DOMContentLoaded', () => {
initAccessRestrictionField('.js-allowed-email-domains', {
initAccessRestrictionField('.js-allowed-email-domains', {
placeholder: __('Enter domain'),
regexErrorMessage: __('The domain you entered is misformatted.'),
disallowedValueErrorMessage: __('The domain you entered is not allowed.'),
});
initAccessRestrictionField(
});
initAccessRestrictionField(
'.js-ip-restriction',
{ placeholder: __('Enter IP address range') },
'ip_restriction_field',
validateRestrictedIpAddress,
);
});
);
import initLDAPGroupsSelect from 'ee/ldap_groups_select';
import initLDAPGroupLinks from 'ee/groups/ldap_group_links';
document.addEventListener('DOMContentLoaded', () => {
initLDAPGroupsSelect();
initLDAPGroupLinks();
});
initLDAPGroupsSelect();
initLDAPGroupLinks();
......@@ -2,7 +2,5 @@ import '~/pages/groups/milestones/show/index';
import initBurndownChart from 'ee/burndown_chart';
import UserCallout from '~/user_callout';
document.addEventListener('DOMContentLoaded', () => {
new UserCallout(); // eslint-disable-line no-new
initBurndownChart();
});
new UserCallout(); // eslint-disable-line no-new
initBurndownChart();
import { mount2faAuthentication } from '~/authentication/mount_2fa';
document.addEventListener('DOMContentLoaded', mount2faAuthentication);
mount2faAuthentication();
import UsernameValidator from '~/pages/sessions/new/username_validator';
import initConfirmDangerModal from '~/confirm_danger_modal';
document.addEventListener('DOMContentLoaded', () => {
new UsernameValidator(); // eslint-disable-line no-new
initConfirmDangerModal();
});
new UsernameValidator(); // eslint-disable-line no-new
initConfirmDangerModal();
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