Commit c6dd3a0a authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch 'cngo-remove-DOMContentLoaded' into 'master'

Delete DOMContentLoaded event listeners

See merge request gitlab-org/gitlab!66365
parents 4cd1fc0a 60d5d033
...@@ -5,4 +5,4 @@ import AbuseReports from './abuse_reports'; ...@@ -5,4 +5,4 @@ import AbuseReports from './abuse_reports';
new AbuseReports(); /* eslint-disable-line no-new */ new AbuseReports(); /* eslint-disable-line no-new */
new UsersSelect(); /* eslint-disable-line no-new */ new UsersSelect(); /* eslint-disable-line no-new */
document.addEventListener('DOMContentLoaded', initDeprecatedRemoveRowBehavior); initDeprecatedRemoveRowBehavior();
import setup from '~/admin/application_settings/setup_metrics_and_profiling'; import setup from '~/admin/application_settings/setup_metrics_and_profiling';
document.addEventListener('DOMContentLoaded', setup); setup();
import IntegrationSettingsForm from '~/integrations/integration_settings_form'; import IntegrationSettingsForm from '~/integrations/integration_settings_form';
import PrometheusMetrics from '~/prometheus_metrics/prometheus_metrics'; import PrometheusMetrics from '~/prometheus_metrics/prometheus_metrics';
document.addEventListener('DOMContentLoaded', () => { function initIntegrations() {
const prometheusSettingsWrapper = document.querySelector('.js-prometheus-metrics-monitoring'); const prometheusSettingsWrapper = document.querySelector('.js-prometheus-metrics-monitoring');
const integrationSettingsForm = new IntegrationSettingsForm('.js-integration-settings-form'); const integrationSettingsForm = new IntegrationSettingsForm('.js-integration-settings-form');
integrationSettingsForm.init(); integrationSettingsForm.init();
...@@ -10,4 +10,6 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -10,4 +10,6 @@ document.addEventListener('DOMContentLoaded', () => {
const prometheusMetrics = new PrometheusMetrics('.js-prometheus-metrics-monitoring'); const prometheusMetrics = new PrometheusMetrics('.js-prometheus-metrics-monitoring');
prometheusMetrics.loadActiveMetrics(); prometheusMetrics.loadActiveMetrics();
} }
}); }
initIntegrations();
...@@ -5,7 +5,7 @@ import stopJobsModal from './components/stop_jobs_modal.vue'; ...@@ -5,7 +5,7 @@ import stopJobsModal from './components/stop_jobs_modal.vue';
Vue.use(Translate); Vue.use(Translate);
document.addEventListener('DOMContentLoaded', () => { function initJobs() {
const buttonId = 'js-stop-jobs-button'; const buttonId = 'js-stop-jobs-button';
const modalId = 'stop-jobs-modal'; const modalId = 'stop-jobs-modal';
const stopJobsButton = document.getElementById(buttonId); const stopJobsButton = document.getElementById(buttonId);
...@@ -31,4 +31,6 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -31,4 +31,6 @@ document.addEventListener('DOMContentLoaded', () => {
}, },
}); });
} }
}); }
initJobs();
document.addEventListener('DOMContentLoaded', () => { function initLabels() {
const pagination = document.querySelector('.labels .gl-pagination'); const pagination = document.querySelector('.labels .gl-pagination');
const emptyState = document.querySelector('.labels .nothing-here-block.hidden'); const emptyState = document.querySelector('.labels .nothing-here-block.hidden');
...@@ -18,4 +18,6 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -18,4 +18,6 @@ document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.js-remove-label').forEach((row) => { document.querySelectorAll('.js-remove-label').forEach((row) => {
row.addEventListener('ajax:success', removeLabelSuccessCallback); row.addEventListener('ajax:success', removeLabelSuccessCallback);
}); });
}); }
initLabels();
import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior'; import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior';
document.addEventListener('DOMContentLoaded', initDeprecatedRemoveRowBehavior); initDeprecatedRemoveRowBehavior();
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