Commit 0f03eaec authored by Jannik Lehmann's avatar Jannik Lehmann Committed by David O'Regan

Remove DOMContentLoaded Eventlisteners

Removing DOMContentLoaded Eventlisteners from
index files since the scripts
are embedded using the defer tag.
parent 871933eb
import $ from 'jquery'; import $ from 'jquery';
import initDependencyProxy from '~/dependency_proxy'; import initDependencyProxy from '~/dependency_proxy';
document.addEventListener('DOMContentLoaded', () => { initDependencyProxy();
initDependencyProxy();
});
document.addEventListener('DOMContentLoaded', () => { const form = document.querySelector('form.edit_dependency_proxy_group_setting');
const form = document.querySelector('form.edit_dependency_proxy_group_setting'); const toggleInput = $('input.js-project-feature-toggle-input');
const toggleInput = $('input.js-project-feature-toggle-input');
if (form && toggleInput) { if (form && toggleInput) {
toggleInput.on('trigger-change', () => { toggleInput.on('trigger-change', () => {
form.submit(); form.submit();
}); });
} }
});
import PersistentUserCallout from '~/persistent_user_callout'; import PersistentUserCallout from '~/persistent_user_callout';
document.addEventListener('DOMContentLoaded', () => { const callout = document.querySelector('.js-gold-trial-callout');
const callout = document.querySelector('.js-gold-trial-callout'); PersistentUserCallout.factory(callout);
PersistentUserCallout.factory(callout);
});
import initIssuesAnalytics from 'ee/issues_analytics'; import initIssuesAnalytics from 'ee/issues_analytics';
document.addEventListener('DOMContentLoaded', () => { initIssuesAnalytics();
initIssuesAnalytics();
});
...@@ -4,18 +4,16 @@ import initRoadmap from 'ee/roadmap/roadmap_bundle'; ...@@ -4,18 +4,16 @@ import initRoadmap from 'ee/roadmap/roadmap_bundle';
import initFilteredSearch from '~/pages/search/init_filtered_search'; import initFilteredSearch from '~/pages/search/init_filtered_search';
import UserCallout from '~/user_callout'; import UserCallout from '~/user_callout';
document.addEventListener('DOMContentLoaded', () => { initFilteredSearch({
initFilteredSearch({ page: 'epics',
page: 'epics', isGroup: true,
isGroup: true, isGroupDecendent: true,
isGroupDecendent: true, useDefaultState: false,
useDefaultState: false, filteredSearchTokenKeys: FilteredSearchTokenKeysEpics,
filteredSearchTokenKeys: FilteredSearchTokenKeysEpics, stateFiltersSelector: '.epics-state-filters',
stateFiltersSelector: '.epics-state-filters',
});
initEpicCreateApp(true);
initRoadmap();
// eslint-disable-next-line no-new
new UserCallout({ className: 'js-epics-limit-callout' });
}); });
initEpicCreateApp(true);
initRoadmap();
// eslint-disable-next-line no-new
new UserCallout({ className: 'js-epics-limit-callout' });
import storageCounter from 'ee/storage_counter'; import storageCounter from 'ee/storage_counter';
import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs'; import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
document.addEventListener('DOMContentLoaded', () => { if (document.querySelector('#js-storage-counter-app')) {
if (document.querySelector('#js-storage-counter-app')) { storageCounter();
storageCounter();
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new LinkedTabs({ new LinkedTabs({
defaultAction: '#pipelines-quota-tab', defaultAction: '#pipelines-quota-tab',
parentEl: '.js-storage-tabs', parentEl: '.js-storage-tabs',
hashedTabs: true, hashedTabs: true,
}); });
} }
});
import storageCounter from 'ee/storage_counter'; import storageCounter from 'ee/storage_counter';
import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs'; import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
document.addEventListener('DOMContentLoaded', () => { if (document.querySelector('#js-storage-counter-app')) {
if (document.querySelector('#js-storage-counter-app')) { storageCounter();
storageCounter();
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new LinkedTabs({ new LinkedTabs({
defaultAction: '#pipelines-quota-tab', defaultAction: '#pipelines-quota-tab',
parentEl: '.js-storage-tabs', parentEl: '.js-storage-tabs',
hashedTabs: true, hashedTabs: true,
}); });
} }
});
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