summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-04-05 10:24:18 +0100
committerPhil Hughes <me@iamphill.com>2018-04-05 10:24:18 +0100
commit891164f10b49417fb0fbcb29638d346e9a56dd63 (patch)
tree1b82793714c9926ec943fb8972e0c00ec7f319d8 /app
parentbc64e20cab52e5dfc1e703a09a6221134957f7ed (diff)
downloadgitlab-ce-891164f10b49417fb0fbcb29638d346e9a56dd63.tar.gz
set `renderSideBySide` when creating diff instance
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/ide/lib/editor.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/ide/lib/editor.js b/app/assets/javascripts/ide/lib/editor.js
index 4f5106d1583..0fa0ddecf13 100644
--- a/app/assets/javascripts/ide/lib/editor.js
+++ b/app/assets/javascripts/ide/lib/editor.js
@@ -69,6 +69,7 @@ export default class Editor {
occurrencesHighlight: false,
renderLineHighlight: 'none',
hideCursorInOverviewRuler: true,
+ renderSideBySide: this.renderSideBySide(domElement),
})),
);
@@ -177,11 +178,15 @@ export default class Editor {
if (!this.isDiffEditorType) return;
this.instance.updateOptions({
- renderSideBySide: this.instance.getDomNode().offsetWidth >= 700,
+ renderSideBySide: this.renderSideBySide(this.instance.getDomNode()),
});
}
get isDiffEditorType() {
return this.instance.getEditorType() === 'vs.editor.IDiffEditor';
}
+
+ renderSideBySide(domElement) {
+ return domElement.offsetWidth >= 700;
+ }
}