Commit 6e2c2ef9 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'jnnkl-remove-eventlistener-projects-new' into 'master'

Remove obsolete DOMContentLoadedEventListener

See merge request gitlab-org/gitlab!54935
parents 83fe4a7c 3289bd8f
...@@ -3,28 +3,26 @@ import { __ } from '~/locale'; ...@@ -3,28 +3,26 @@ import { __ } from '~/locale';
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', () => { initProjectVisibilitySelector();
initProjectVisibilitySelector(); initProjectNew.bindEvents();
initProjectNew.bindEvents();
import( import(
/* webpackChunkName: 'experiment_new_project_creation' */ '../../../projects/experiment_new_project_creation' /* webpackChunkName: 'experiment_new_project_creation' */ '../../../projects/experiment_new_project_creation'
) )
.then((m) => { .then((m) => {
const el = document.querySelector('.js-experiment-new-project-creation'); const el = document.querySelector('.js-experiment-new-project-creation');
if (!el) { if (!el) {
return; return;
} }
const config = { const config = {
hasErrors: 'hasErrors' in el.dataset, hasErrors: 'hasErrors' in el.dataset,
isCiCdAvailable: 'isCiCdAvailable' in el.dataset, isCiCdAvailable: 'isCiCdAvailable' in el.dataset,
newProjectGuidelines: el.dataset.newProjectGuidelines, newProjectGuidelines: el.dataset.newProjectGuidelines,
}; };
m.default(el, config); m.default(el, config);
}) })
.catch(() => { .catch(() => {
createFlash(__('An error occurred while loading project creation UI')); createFlash(__('An error occurred while loading project creation UI'));
}); });
});
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