From 7d5e6412bef7fd457e22532faf859e551f8196fc Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 6 Mar 2020 11:28:26 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/editor/editor_lite.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/assets/javascripts/editor') 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 = '' } = {}) { -- cgit v1.2.3