Commit 268be250 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch 'remove-EventListeners-from-analytics-pages' into 'master'

Remove DOMContentLoaded Eventlistener

See merge request gitlab-org/gitlab!47648
parents aa7b4408 e573e772
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