Commit 8822a07e authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'jnnkl-eventlistener-merge-request-new' into 'master'

Remove obsolete DOMContentLoadedEventListener

See merge request gitlab-org/gitlab!53867
parents 966392e7 5ef108a1
import initMergeRequest from '~/pages/projects/merge_requests/init_merge_request';
document.addEventListener('DOMContentLoaded', initMergeRequest);
initMergeRequest();
......@@ -2,16 +2,14 @@ import initPipelines from '~/commit/pipelines/pipelines_bundle';
import MergeRequest from '~/merge_request';
import initCompare from './compare';
document.addEventListener('DOMContentLoaded', () => {
const mrNewCompareNode = document.querySelector('.js-merge-request-new-compare');
if (mrNewCompareNode) {
initCompare(mrNewCompareNode);
} else {
const mrNewSubmitNode = document.querySelector('.js-merge-request-new-submit');
// eslint-disable-next-line no-new
new MergeRequest({
action: mrNewSubmitNode.dataset.mrSubmitAction,
});
initPipelines();
}
});
const mrNewCompareNode = document.querySelector('.js-merge-request-new-compare');
if (mrNewCompareNode) {
initCompare(mrNewCompareNode);
} else {
const mrNewSubmitNode = document.querySelector('.js-merge-request-new-submit');
// eslint-disable-next-line no-new
new MergeRequest({
action: mrNewSubmitNode.dataset.mrSubmitAction,
});
initPipelines();
}
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