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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 14:28:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 14:28:26 +0300
commit7d5e6412bef7fd457e22532faf859e551f8196fc (patch)
treedc62b4a7a5fad8ba0ba260ae82e95f8e984f2398 /app/assets/javascripts/editor
parent8e94dad32b10edebf79285c083176c2b7005ef64 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/editor')
-rw-r--r--app/assets/javascripts/editor/editor_lite.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/editor/editor_lite.js b/app/assets/javascripts/editor/editor_lite.js
index 8711f6e65af..c2723b1d506 100644
--- a/app/assets/javascripts/editor/editor_lite.js
+++ b/app/assets/javascripts/editor/editor_lite.js
@@ -1,5 +1,5 @@
import { editor as monacoEditor, languages as monacoLanguages, Uri } from 'monaco-editor';
-import whiteTheme from '~/ide/lib/themes/white';
+import { DEFAULT_THEME, themes } from '~/ide/lib/themes';
import { defaultEditorOptions } from '~/ide/lib/editor_options';
import { clearDomElement } from './utils';
@@ -19,8 +19,10 @@ export default class Editor {
}
static setupMonacoTheme() {
- monacoEditor.defineTheme('white', whiteTheme);
- monacoEditor.setTheme('white');
+ const themeName = window.gon?.user_color_scheme || DEFAULT_THEME;
+ const theme = themes.find(t => t.name === themeName);
+ if (theme) monacoEditor.defineTheme(themeName, theme.data);
+ monacoEditor.setTheme(theme ? themeName : DEFAULT_THEME);
}
createInstance({ el = undefined, blobPath = '', blobContent = '' } = {}) {