Commit 306e2d8c authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'jnnkl-DOM-Loaded-behaviours' into 'master'

Remove obsolete DOMContentLoadedEventListener

See merge request gitlab-org/gitlab!52309
parents 5a70276c 703d8dd9
...@@ -25,19 +25,17 @@ initPageShortcuts(); ...@@ -25,19 +25,17 @@ initPageShortcuts();
initCollapseSidebarOnWindowResize(); initCollapseSidebarOnWindowResize();
initSelect2Dropdowns(); initSelect2Dropdowns();
document.addEventListener('DOMContentLoaded', () => { window.requestIdleCallback(
window.requestIdleCallback( () => {
() => { // Check if we have to Load GFM Input
// Check if we have to Load GFM Input const $gfmInputs = $('.js-gfm-input:not(.js-gfm-input-initialized)');
const $gfmInputs = $('.js-gfm-input:not(.js-gfm-input-initialized)'); if ($gfmInputs.length) {
if ($gfmInputs.length) { import(/* webpackChunkName: 'initGFMInput' */ './markdown/gfm_auto_complete')
import(/* webpackChunkName: 'initGFMInput' */ './markdown/gfm_auto_complete') .then(({ default: initGFMInput }) => {
.then(({ default: initGFMInput }) => { initGFMInput($gfmInputs);
initGFMInput($gfmInputs); })
}) .catch(() => {});
.catch(() => {}); }
} },
}, { timeout: 500 },
{ timeout: 500 }, );
);
});
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