Commit 5a07d564 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 b53f0806
...@@ -2,8 +2,6 @@ import UsersSelect from '~/users_select'; ...@@ -2,8 +2,6 @@ import UsersSelect from '~/users_select';
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import initBoards from '~/boards'; import initBoards from '~/boards';
document.addEventListener('DOMContentLoaded', () => { new UsersSelect(); // eslint-disable-line no-new
new UsersSelect(); // eslint-disable-line no-new new ShortcutsNavigation(); // eslint-disable-line no-new
new ShortcutsNavigation(); // eslint-disable-line no-new initBoards();
initBoards();
});
import initForm from '../../../../shared/milestones/form'; import initForm from '../../../../shared/milestones/form';
document.addEventListener('DOMContentLoaded', () => initForm(false)); initForm(false);
import initForm from '../../../../shared/milestones/form'; import initForm from '../../../../shared/milestones/form';
document.addEventListener('DOMContentLoaded', () => initForm(false)); initForm(false);
...@@ -4,13 +4,11 @@ import Group from '~/group'; ...@@ -4,13 +4,11 @@ import Group from '~/group';
import GroupPathValidator from './group_path_validator'; import GroupPathValidator from './group_path_validator';
import initFilePickers from '~/file_pickers'; import initFilePickers from '~/file_pickers';
document.addEventListener('DOMContentLoaded', () => { const parentId = $('#group_parent_id');
const parentId = $('#group_parent_id'); if (!parentId.val()) {
if (!parentId.val()) {
new GroupPathValidator(); // eslint-disable-line no-new new GroupPathValidator(); // eslint-disable-line no-new
} }
BindInOut.initAll(); BindInOut.initAll();
initFilePickers(); initFilePickers();
return new Group(); new Group(); // eslint-disable-line no-new
});
import initPackageList from '~/packages/list/packages_list_app_bundle'; import initPackageList from '~/packages/list/packages_list_app_bundle';
document.addEventListener('DOMContentLoaded', () => { if (document.getElementById('js-vue-packages-list')) {
if (document.getElementById('js-vue-packages-list')) {
initPackageList(); initPackageList();
} }
});
...@@ -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();
});
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