summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-02-27 16:53:49 -0600
committerMike Greiling <mike@pixelcog.com>2018-02-27 16:53:49 -0600
commitc62fe6a293f62d37d9290074b917cc67a78b6cfd (patch)
treeec37025b39f33528a957a5868ee102147c8b2c95 /app/assets/javascripts
parent94d5dd3b7bf5fb922458cec7659754164e8182c6 (diff)
downloadgitlab-ce-c62fe6a293f62d37d9290074b917cc67a78b6cfd.tar.gz
refactor merge conflicts bundle to reduce side effects
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js4
-rw-r--r--app/assets/javascripts/pages/projects/merge_requests/conflicts/index.js7
2 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js b/app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
index b4b3c15108d..66b258839ae 100644
--- a/app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
+++ b/app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
@@ -12,7 +12,7 @@ import './components/inline_conflict_lines';
import './components/parallel_conflict_lines';
import syntaxHighlight from '../syntax_highlight';
-$(() => {
+export default function initMergeConflicts() {
const INTERACTIVE_RESOLVE_MODE = 'interactive';
const conflictsEl = document.querySelector('#conflicts');
const mergeConflictsStore = gl.mergeConflicts.mergeConflictsStore;
@@ -91,4 +91,4 @@ $(() => {
}
}
});
-});
+}
diff --git a/app/assets/javascripts/pages/projects/merge_requests/conflicts/index.js b/app/assets/javascripts/pages/projects/merge_requests/conflicts/index.js
index 233457ec61b..28641104c58 100644
--- a/app/assets/javascripts/pages/projects/merge_requests/conflicts/index.js
+++ b/app/assets/javascripts/pages/projects/merge_requests/conflicts/index.js
@@ -1,4 +1,7 @@
import initSidebarBundle from '~/sidebar/sidebar_bundle';
-import '~/merge_conflicts/merge_conflicts_bundle';
+import initMergeConflicts from '~/merge_conflicts/merge_conflicts_bundle';
-document.addEventListener('DOMContentLoaded', initSidebarBundle);
+document.addEventListener('DOMContentLoaded', () => {
+ initSidebarBundle();
+ initMergeConflicts();
+});