Commit e573e772 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
document.addEventListener('DOMContentLoaded', () => {
const licenseFile = document.querySelector('.license-file');
const licenseKey = document.querySelector('.license-key');
const acceptEULACheckBox = document.querySelector('#accept_eula');
const uploadLicenseBtn = document.querySelector('#js-upload-license');
const licenseType = document.querySelectorAll('input[name="license_type"]');
const licenseFile = document.querySelector('.license-file');
const licenseKey = document.querySelector('.license-key');
const acceptEULACheckBox = document.querySelector('#accept_eula');
const uploadLicenseBtn = document.querySelector('#js-upload-license');
const licenseType = document.querySelectorAll('input[name="license_type"]');
const showLicenseType = () => {
const checkedFile =
document.querySelector('input[name="license_type"]:checked').value === 'file';
const showLicenseType = () => {
const checkedFile = document.querySelector('input[name="license_type"]:checked').value === 'file';
licenseFile.classList.toggle('hidden', !checkedFile);
licenseKey.classList.toggle('hidden', checkedFile);
};
licenseFile.classList.toggle('hidden', !checkedFile);
licenseKey.classList.toggle('hidden', checkedFile);
};
const toggleUploadLicenseButton = () => {
uploadLicenseBtn.toggleAttribute('disabled', !acceptEULACheckBox.checked);
};
const toggleUploadLicenseButton = () => {
uploadLicenseBtn.toggleAttribute('disabled', !acceptEULACheckBox.checked);
};
licenseType.forEach(el => el.addEventListener('change', showLicenseType));
acceptEULACheckBox.addEventListener('change', toggleUploadLicenseButton);
showLicenseType();
});
licenseType.forEach(el => el.addEventListener('change', showLicenseType));
acceptEULACheckBox.addEventListener('change', toggleUploadLicenseButton);
showLicenseType();
import initCodeReviewAnalyticsApp from 'ee/analytics/code_review_analytics/code_review_analytics_bundle';
document.addEventListener('DOMContentLoaded', () => {
initCodeReviewAnalyticsApp();
});
initCodeReviewAnalyticsApp();
import initIssuesAnalytics from 'ee/issues_analytics';
document.addEventListener('DOMContentLoaded', () => {
initIssuesAnalytics();
});
initIssuesAnalytics();
import initMergeRequestAnalyticsApp from 'ee/analytics/merge_request_analytics';
document.addEventListener('DOMContentLoaded', initMergeRequestAnalyticsApp);
initMergeRequestAnalyticsApp();
import initLicenseComplianceApp from 'ee/license_compliance';
document.addEventListener('DOMContentLoaded', initLicenseComplianceApp);
initLicenseComplianceApp();
import initSidebarBundle from '~/sidebar/sidebar_bundle';
import initMergeConflicts from '~/merge_conflicts/merge_conflicts_bundle';
document.addEventListener('DOMContentLoaded', () => {
initSidebarBundle();
initMergeConflicts();
});
initSidebarBundle();
initMergeConflicts();
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