diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-06 11:28:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-06 11:28:26 +0000 |
commit | 7d5e6412bef7fd457e22532faf859e551f8196fc (patch) | |
tree | dc62b4a7a5fad8ba0ba260ae82e95f8e984f2398 /app/assets/javascripts/editor | |
parent | 8e94dad32b10edebf79285c083176c2b7005ef64 (diff) | |
download | gitlab-ce-7d5e6412bef7fd457e22532faf859e551f8196fc.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/editor')
-rw-r--r-- | app/assets/javascripts/editor/editor_lite.js | 8 |
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 = '' } = {}) { |