Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/merge_conflicts/components/diff_file_editor.js')
-rw-r--r--app/assets/javascripts/merge_conflicts/components/diff_file_editor.js33
1 files changed, 21 insertions, 12 deletions
diff --git a/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js b/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js
index 356d8619fed..338fbd9078a 100644
--- a/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js
+++ b/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js
@@ -6,7 +6,7 @@ import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as flash } from '~/flash';
import { __ } from '~/locale';
-(global => {
+((global) => {
global.mergeConflicts = global.mergeConflicts || {};
global.mergeConflicts.diffFileEditor = Vue.extend({
@@ -60,19 +60,28 @@ import { __ } from '~/locale';
const DataPromise = axios.get(this.file.content_path);
Promise.all([EditorPromise, DataPromise])
- .then(([{ default: EditorLite }, { data: { content, new_path: path } }]) => {
- const contentEl = this.$el.querySelector('.editor');
+ .then(
+ ([
+ { default: EditorLite },
+ {
+ data: { content, new_path: path },
+ },
+ ]) => {
+ const contentEl = this.$el.querySelector('.editor');
- this.originalContent = content;
- this.fileLoaded = true;
+ this.originalContent = content;
+ this.fileLoaded = true;
- this.editor = new EditorLite().createInstance({
- el: contentEl,
- blobPath: path,
- blobContent: content,
- });
- this.editor.onDidChangeModelContent(debounce(this.saveDiffResolution.bind(this), 250));
- })
+ this.editor = new EditorLite().createInstance({
+ el: contentEl,
+ blobPath: path,
+ blobContent: content,
+ });
+ this.editor.onDidChangeModelContent(
+ debounce(this.saveDiffResolution.bind(this), 250),
+ );
+ },
+ )
.catch(() => {
flash(__('An error occurred while loading the file'));
});