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'; 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'; ...@@ -2,16 +2,14 @@ import initPipelines from '~/commit/pipelines/pipelines_bundle';
import MergeRequest from '~/merge_request'; import MergeRequest from '~/merge_request';
import initCompare from './compare'; import initCompare from './compare';
document.addEventListener('DOMContentLoaded', () => { const mrNewCompareNode = document.querySelector('.js-merge-request-new-compare');
const mrNewCompareNode = document.querySelector('.js-merge-request-new-compare'); if (mrNewCompareNode) {
if (mrNewCompareNode) {
initCompare(mrNewCompareNode); initCompare(mrNewCompareNode);
} else { } else {
const mrNewSubmitNode = document.querySelector('.js-merge-request-new-submit'); const mrNewSubmitNode = document.querySelector('.js-merge-request-new-submit');
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new MergeRequest({ new MergeRequest({
action: mrNewSubmitNode.dataset.mrSubmitAction, action: mrNewSubmitNode.dataset.mrSubmitAction,
}); });
initPipelines(); 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