Commit c1ae4bef 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 5fa9332d
import initComplianceDashboard from 'ee/compliance_dashboard/compliance_dashboard_bundle'; import initComplianceDashboard from 'ee/compliance_dashboard/compliance_dashboard_bundle';
document.addEventListener('DOMContentLoaded', initComplianceDashboard); initComplianceDashboard();
import initSecurityCharts from 'ee/security_dashboard/security_charts_init'; import initSecurityCharts from 'ee/security_dashboard/security_charts_init';
import { DASHBOARD_TYPES } from 'ee/security_dashboard/store/constants'; import { DASHBOARD_TYPES } from 'ee/security_dashboard/store/constants';
document.addEventListener('DOMContentLoaded', () => { initSecurityCharts(document.getElementById('js-group-security-dashboard'), DASHBOARD_TYPES.GROUP);
initSecurityCharts(document.getElementById('js-group-security-dashboard'), DASHBOARD_TYPES.GROUP);
});
import initCardSecurityDiscover from 'ee/vue_shared/discover/card_security_discover_bundle'; import initCardSecurityDiscover from 'ee/vue_shared/discover/card_security_discover_bundle';
document.addEventListener('DOMContentLoaded', initCardSecurityDiscover); initCardSecurityDiscover();
import Vue from 'vue'; import Vue from 'vue';
import MainApp from 'ee/vulnerabilities/components/vulnerability.vue'; import MainApp from 'ee/vulnerabilities/components/vulnerability.vue';
function createMainApp() { (function createMainApp() {
const el = document.getElementById('js-vulnerability-main'); const el = document.getElementById('js-vulnerability-main');
const vulnerability = JSON.parse(el.dataset.vulnerability); const vulnerability = JSON.parse(el.dataset.vulnerability);
...@@ -22,8 +22,4 @@ function createMainApp() { ...@@ -22,8 +22,4 @@ function createMainApp() {
props: { vulnerability }, props: { vulnerability },
}), }),
}); });
} })();
window.addEventListener('DOMContentLoaded', () => {
createMainApp();
});
---
title: Removed DOMContentLoaded Eventlistener from Security Pages
merge_request: 47542
author:
type: changed
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