Commit b0f49539 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch 'remove-DOM-Content-Loaded-EventListener-from-registration-pages' into 'master'

Remove DOMContentLoaded Eventlistener

See merge request gitlab-org/gitlab!47619
parents c35fac56 3cb1ac27
import initProductivityAnalyticsApp from 'ee/analytics/productivity_analytics'; import initProductivityAnalyticsApp from 'ee/analytics/productivity_analytics';
document.addEventListener('DOMContentLoaded', () => { initProductivityAnalyticsApp();
initProductivityAnalyticsApp();
});
...@@ -5,9 +5,7 @@ import GroupPathValidator from '~/pages/groups/new/group_path_validator'; ...@@ -5,9 +5,7 @@ import GroupPathValidator from '~/pages/groups/new/group_path_validator';
import BindInOut from '~/behaviors/bind_in_out'; import BindInOut from '~/behaviors/bind_in_out';
import Group from '~/group'; import Group from '~/group';
document.addEventListener('DOMContentLoaded', () => { mountComponents();
mountComponents(); new GroupPathValidator();
new GroupPathValidator(); BindInOut.initAll();
BindInOut.initAll(); new Group();
new Group();
});
...@@ -2,8 +2,6 @@ import mountProgressBar from 'ee/registrations/projects/new'; ...@@ -2,8 +2,6 @@ import mountProgressBar from 'ee/registrations/projects/new';
import initProjectVisibilitySelector from '~/project_visibility'; import initProjectVisibilitySelector from '~/project_visibility';
import initProjectNew from '~/projects/project_new'; import initProjectNew from '~/projects/project_new';
document.addEventListener('DOMContentLoaded', () => { mountProgressBar();
mountProgressBar(); initProjectVisibilitySelector();
initProjectVisibilitySelector(); initProjectNew.bindEvents();
initProjectNew.bindEvents();
});
import mountProgressBar from 'ee/registrations/welcome'; import mountProgressBar from 'ee/registrations/welcome';
document.addEventListener('DOMContentLoaded', () => { mountProgressBar();
mountProgressBar();
});
import mountProgressBar from 'ee/registrations/welcome'; import mountProgressBar from 'ee/registrations/welcome';
document.addEventListener('DOMContentLoaded', () => { mountProgressBar();
mountProgressBar();
const emailUpdatesForm = document.querySelector('.js-email-opt-in'); const emailUpdatesForm = document.querySelector('.js-email-opt-in');
const setupForCompany = document.querySelector('.js-setup-for-company'); const setupForCompany = document.querySelector('.js-setup-for-company');
const setupForMe = document.querySelector('.js-setup-for-me'); const setupForMe = document.querySelector('.js-setup-for-me');
setupForCompany.addEventListener('change', () => { setupForCompany.addEventListener('change', () => {
emailUpdatesForm.classList.add('hidden'); emailUpdatesForm.classList.add('hidden');
}); });
setupForMe.addEventListener('change', () => { setupForMe.addEventListener('change', () => {
emailUpdatesForm.classList.remove('hidden'); emailUpdatesForm.classList.remove('hidden');
});
}); });
---
title: Remove DOMContentLoaded Eventlistener
merge_request: 47619
author:
type: performance
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