Commit 96622a10 authored by Jannik Lehmann's avatar Jannik Lehmann

Remove obsolete DOMContentLoadedEventListener

parent fdecd2cd
import initFilePickers from '~/file_pickers'; import initFilePickers from '~/file_pickers';
document.addEventListener('DOMContentLoaded', initFilePickers); initFilePickers();
import initSettingsPanels from '~/settings_panels'; import initSettingsPanels from '~/settings_panels';
document.addEventListener('DOMContentLoaded', () => { // Initialize expandable settings panels
// Initialize expandable settings panels initSettingsPanels();
initSettingsPanels();
const domainCard = document.querySelector('.js-domain-cert-show'); const domainCard = document.querySelector('.js-domain-cert-show');
const domainForm = document.querySelector('.js-domain-cert-inputs'); const domainForm = document.querySelector('.js-domain-cert-inputs');
const domainReplaceButton = document.querySelector('.js-domain-cert-replace-btn'); const domainReplaceButton = document.querySelector('.js-domain-cert-replace-btn');
const domainSubmitButton = document.querySelector('.js-serverless-domain-submit'); const domainSubmitButton = document.querySelector('.js-serverless-domain-submit');
if (domainReplaceButton && domainCard && domainForm) { if (domainReplaceButton && domainCard && domainForm) {
domainReplaceButton.addEventListener('click', () => { domainReplaceButton.addEventListener('click', () => {
domainCard.classList.add('hidden'); domainCard.classList.add('hidden');
domainForm.classList.remove('hidden'); domainForm.classList.remove('hidden');
domainSubmitButton.removeAttribute('disabled'); domainSubmitButton.removeAttribute('disabled');
}); });
} }
});
...@@ -5,6 +5,4 @@ import Translate from '~/vue_shared/translate'; ...@@ -5,6 +5,4 @@ import Translate from '~/vue_shared/translate';
Vue.use(Translate); Vue.use(Translate);
document.addEventListener('DOMContentLoaded', () => { mountBadgeSettings(GROUP_BADGE);
mountBadgeSettings(GROUP_BADGE);
});
import mountImportProjectsTable from '~/import_entities/import_projects'; import mountImportProjectsTable from '~/import_entities/import_projects';
document.addEventListener('DOMContentLoaded', () => { const mountElement = document.getElementById('import-projects-mount-element');
const mountElement = document.getElementById('import-projects-mount-element');
mountImportProjectsTable(mountElement); mountImportProjectsTable(mountElement);
});
...@@ -5,9 +5,7 @@ import initCompareSelector from '~/projects/compare'; ...@@ -5,9 +5,7 @@ import initCompareSelector from '~/projects/compare';
initCompareSelector(); initCompareSelector();
document.addEventListener('DOMContentLoaded', () => { new Diff(); // eslint-disable-line no-new
new Diff(); // eslint-disable-line no-new const paddingTop = 16;
const paddingTop = 16; initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - paddingTop);
initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - paddingTop); GpgBadges.fetch();
GpgBadges.fetch();
});
import initCycleAnalytics from '~/cycle_analytics'; import initCycleAnalytics from '~/cycle_analytics';
document.addEventListener('DOMContentLoaded', initCycleAnalytics); initCycleAnalytics();
import initContributorsGraphs from '~/contributors'; import initContributorsGraphs from '~/contributors';
document.addEventListener('DOMContentLoaded', initContributorsGraphs); initContributorsGraphs();
import mountJiraImportApp from '~/jira_import'; import mountJiraImportApp from '~/jira_import';
document.addEventListener('DOMContentLoaded', mountJiraImportApp); mountJiraImportApp();
import initForm from 'ee_else_ce/pages/projects/issues/form'; import initForm from 'ee_else_ce/pages/projects/issues/form';
document.addEventListener('DOMContentLoaded', initForm); initForm();
import initTerminal from '~/terminal/'; import initTerminal from '~/terminal/';
document.addEventListener('DOMContentLoaded', initTerminal); initTerminal();
import initForm from '~/pages/projects/pages_domains/form'; import initForm from '~/pages/projects/pages_domains/form';
document.addEventListener('DOMContentLoaded', initForm); initForm();
import initForm from '~/pages/projects/pages_domains/form'; import initForm from '~/pages/projects/pages_domains/form';
document.addEventListener('DOMContentLoaded', initForm); initForm();
import Vue from 'vue'; import Vue from 'vue';
import PipelineSchedulesCallout from '../shared/components/pipeline_schedules_callout.vue'; import PipelineSchedulesCallout from '../shared/components/pipeline_schedules_callout.vue';
document.addEventListener('DOMContentLoaded', () => { function initPipelineSchedules() {
const el = document.getElementById('pipeline-schedules-callout'); const el = document.getElementById('pipeline-schedules-callout');
if (!el) { if (!el) {
...@@ -21,4 +21,6 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -21,4 +21,6 @@ document.addEventListener('DOMContentLoaded', () => {
return createElement(PipelineSchedulesCallout); return createElement(PipelineSchedulesCallout);
}, },
}); });
}); }
initPipelineSchedules();
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