diff options
Diffstat (limited to 'app/assets/javascripts/pages/projects/merge_requests/creations')
3 files changed, 15 insertions, 17 deletions
diff --git a/app/assets/javascripts/pages/projects/merge_requests/creations/index.js b/app/assets/javascripts/pages/projects/merge_requests/creations/index.js index febfecebbd2..34d9fa03d24 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/creations/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/creations/index.js @@ -1,3 +1,3 @@ import initMergeRequest from '~/pages/projects/merge_requests/init_merge_request'; -document.addEventListener('DOMContentLoaded', initMergeRequest); +initMergeRequest(); diff --git a/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js b/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js index eb2692c7cb4..1a0fa6e544e 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js +++ b/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js @@ -1,7 +1,7 @@ import $ from 'jquery'; -import { localTimeAgo } from '~/lib/utils/datetime_utility'; -import axios from '~/lib/utils/axios_utils'; import initCompareAutocomplete from '~/compare_autocomplete'; +import axios from '~/lib/utils/axios_utils'; +import { localTimeAgo } from '~/lib/utils/datetime_utility'; import initTargetProjectDropdown from './target_project_dropdown'; const updateCommitList = (url, $loadingIndicator, $commitList, params) => { diff --git a/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js b/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js index 01a0b4870c1..9aecd154483 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js @@ -1,17 +1,15 @@ -import MergeRequest from '~/merge_request'; 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(); +} |