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