Commit e283ce09 authored by Miguel Rincon's avatar Miguel Rincon

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

Delete DOMContentLoaded event listeners

See merge request gitlab-org/gitlab!83182
parents bc45b868 c6fcc302
......@@ -48,4 +48,4 @@ export function initJiraConnect() {
});
}
document.addEventListener('DOMContentLoaded', initJiraConnect);
initJiraConnect();
import initClustersListApp from '~/clusters_list';
import PersistentUserCallout from '~/persistent_user_callout';
document.addEventListener('DOMContentLoaded', () => {
const callout = document.querySelector('.gcp-signup-offer');
PersistentUserCallout.factory(callout);
initClustersListApp();
});
const callout = document.querySelector('.gcp-signup-offer');
PersistentUserCallout.factory(callout);
initClustersListApp();
......@@ -10,21 +10,19 @@ import initSearchSettings from '~/search_settings';
import initSettingsPanels from '~/settings_panels';
import initConfirmDanger from '~/init_confirm_danger';
document.addEventListener('DOMContentLoaded', () => {
initFilePickers();
initConfirmDanger();
initSettingsPanels();
initTransferGroupForm();
dirtySubmitFactory(
initFilePickers();
initConfirmDanger();
initSettingsPanels();
initTransferGroupForm();
dirtySubmitFactory(
document.querySelectorAll('.js-general-settings-form, .js-general-permissions-form'),
);
mountBadgeSettings(GROUP_BADGE);
);
mountBadgeSettings(GROUP_BADGE);
// Initialize Subgroups selector
groupsSelect();
// Initialize Subgroups selector
groupsSelect();
projectSelect();
projectSelect();
initSearchSettings();
initCascadingSettingsLockPopovers();
});
initSearchSettings();
initCascadingSettingsLockPopovers();
import initProfilePreferences from '~/profile/preferences/profile_preferences_bundle';
document.addEventListener('DOMContentLoaded', initProfilePreferences);
initProfilePreferences();
......@@ -10,36 +10,34 @@ import initSharedRunnersToggle from '~/projects/settings/mount_shared_runners_to
import initSettingsPanels from '~/settings_panels';
import { initTokenAccess } from '~/token_access';
document.addEventListener('DOMContentLoaded', () => {
// Initialize expandable settings panels
initSettingsPanels();
// Initialize expandable settings panels
initSettingsPanels();
const runnerToken = document.querySelector('.js-secret-runner-token');
if (runnerToken) {
const runnerToken = document.querySelector('.js-secret-runner-token');
if (runnerToken) {
const runnerTokenSecretValue = new SecretValues({
container: runnerToken,
});
runnerTokenSecretValue.init();
}
}
initVariableList();
initVariableList();
// hide extra auto devops settings based checkbox state
const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings');
const instanceDefaultBadge = document.querySelector('.js-instance-default-badge');
document.querySelector('.js-toggle-extra-settings').addEventListener('click', (event) => {
// hide extra auto devops settings based checkbox state
const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings');
const instanceDefaultBadge = document.querySelector('.js-instance-default-badge');
document.querySelector('.js-toggle-extra-settings').addEventListener('click', (event) => {
const { target } = event;
if (instanceDefaultBadge) instanceDefaultBadge.style.display = 'none';
autoDevOpsExtraSettings.classList.toggle('hidden', !target.checked);
});
});
registrySettingsApp();
initDeployFreeze();
registrySettingsApp();
initDeployFreeze();
initSettingsPipelinesTriggers();
initArtifactsSettings();
initSharedRunnersToggle();
initInstallRunner();
initRunnerAwsDeployments();
initTokenAccess();
});
initSettingsPipelinesTriggers();
initArtifactsSettings();
initSharedRunnersToggle();
initInstallRunner();
initRunnerAwsDeployments();
initTokenAccess();
import MirrorRepos from '~/mirrors/mirror_repos';
import initForm from '../form';
document.addEventListener('DOMContentLoaded', () => {
initForm();
initForm();
const mirrorReposContainer = document.querySelector('.js-mirror-settings');
if (mirrorReposContainer) new MirrorRepos(mirrorReposContainer).init();
});
const mirrorReposContainer = document.querySelector('.js-mirror-settings');
if (mirrorReposContainer) new MirrorRepos(mirrorReposContainer).init();
import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior';
document.addEventListener('DOMContentLoaded', () => {
initDeprecatedRemoveRowBehavior();
initDeprecatedRemoveRowBehavior();
const locks = document.querySelector('.locks');
const locks = document.querySelector('.locks');
locks.addEventListener('ajax:success', () => {
locks.addEventListener('ajax:success', () => {
const allRowsHidden = [...locks.querySelectorAll('li')].every((x) => x.offsetParent === null);
if (allRowsHidden) {
locks.querySelector('.nothing-here-block.hidden')?.classList?.remove('hidden');
}
});
});
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