From 49f1d1dac2c89a92998152e1230c793278f5b2af Mon Sep 17 00:00:00 2001
From: Jannik Lehmann <jlehmann@gitlab.com>
Date: Fri, 13 Nov 2020 15:35:33 +0100
Subject: [PATCH] Remove DOMContentLoaded Eventlisteners

Removing DOMContentLoaded Eventlisteners from
index files since the scripts
are embedded using the defer tag.
---
 ee/app/assets/javascripts/pages/projects/blob/show/index.js   | 2 +-
 ee/app/assets/javascripts/pages/projects/iterations/index.js  | 2 +-
 .../pages/projects/iterations/inherited/show/index.js         | 4 +---
 .../pages/projects/threat_monitoring/edit/index.js            | 2 +-
 .../javascripts/pages/projects/threat_monitoring/new/index.js | 2 +-
 .../pages/projects/threat_monitoring/show/index.js            | 2 +-
 6 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/ee/app/assets/javascripts/pages/projects/blob/show/index.js b/ee/app/assets/javascripts/pages/projects/blob/show/index.js
index cdf7f57f4a3..8f713786d63 100644
--- a/ee/app/assets/javascripts/pages/projects/blob/show/index.js
+++ b/ee/app/assets/javascripts/pages/projects/blob/show/index.js
@@ -1,4 +1,4 @@
 import '~/pages/projects/blob/show/index';
 import initBlob from '../../shared/init_blob';
 
-document.addEventListener('DOMContentLoaded', initBlob);
+initBlob();
diff --git a/ee/app/assets/javascripts/pages/projects/iterations/index.js b/ee/app/assets/javascripts/pages/projects/iterations/index.js
index a1fc71a2951..98d7c9613dd 100644
--- a/ee/app/assets/javascripts/pages/projects/iterations/index.js
+++ b/ee/app/assets/javascripts/pages/projects/iterations/index.js
@@ -1,4 +1,4 @@
 import { initIterationsList } from 'ee/iterations';
 import { Namespace } from 'ee/iterations/constants';
 
-document.addEventListener('DOMContentLoaded', () => initIterationsList(Namespace.Project));
+initIterationsList(Namespace.Project);
diff --git a/ee/app/assets/javascripts/pages/projects/iterations/inherited/show/index.js b/ee/app/assets/javascripts/pages/projects/iterations/inherited/show/index.js
index 5843420a0c4..51cff657071 100644
--- a/ee/app/assets/javascripts/pages/projects/iterations/inherited/show/index.js
+++ b/ee/app/assets/javascripts/pages/projects/iterations/inherited/show/index.js
@@ -1,6 +1,4 @@
 import { initIterationReport } from 'ee/iterations';
 import { Namespace } from 'ee/iterations/constants';
 
-document.addEventListener('DOMContentLoaded', () => {
-  initIterationReport({ namespaceType: Namespace.Project });
-});
+initIterationReport({ namespaceType: Namespace.Project });
diff --git a/ee/app/assets/javascripts/pages/projects/threat_monitoring/edit/index.js b/ee/app/assets/javascripts/pages/projects/threat_monitoring/edit/index.js
index faa91b2f32b..9bc61c9e6a2 100644
--- a/ee/app/assets/javascripts/pages/projects/threat_monitoring/edit/index.js
+++ b/ee/app/assets/javascripts/pages/projects/threat_monitoring/edit/index.js
@@ -1,3 +1,3 @@
 import initPolicyEditorApp from 'ee/threat_monitoring/policy_editor';
 
-document.addEventListener('DOMContentLoaded', initPolicyEditorApp);
+initPolicyEditorApp();
diff --git a/ee/app/assets/javascripts/pages/projects/threat_monitoring/new/index.js b/ee/app/assets/javascripts/pages/projects/threat_monitoring/new/index.js
index faa91b2f32b..9bc61c9e6a2 100644
--- a/ee/app/assets/javascripts/pages/projects/threat_monitoring/new/index.js
+++ b/ee/app/assets/javascripts/pages/projects/threat_monitoring/new/index.js
@@ -1,3 +1,3 @@
 import initPolicyEditorApp from 'ee/threat_monitoring/policy_editor';
 
-document.addEventListener('DOMContentLoaded', initPolicyEditorApp);
+initPolicyEditorApp();
diff --git a/ee/app/assets/javascripts/pages/projects/threat_monitoring/show/index.js b/ee/app/assets/javascripts/pages/projects/threat_monitoring/show/index.js
index ada681e8214..8ed2d3371da 100644
--- a/ee/app/assets/javascripts/pages/projects/threat_monitoring/show/index.js
+++ b/ee/app/assets/javascripts/pages/projects/threat_monitoring/show/index.js
@@ -1,3 +1,3 @@
 import initThreatMonitoringApp from 'ee/threat_monitoring';
 
-document.addEventListener('DOMContentLoaded', initThreatMonitoringApp);
+initThreatMonitoringApp();
-- 
2.30.9