From b3263b41ff70c083615476c71ad18ef77f712374 Mon Sep 17 00:00:00 2001 From: sota1235 Date: Thu, 22 Dec 2016 14:05:43 +0900 Subject: [PATCH] Revert "fix: default.css not found" This reverts commit 7b55454a73b3eebbfe1ed4684157c2d822ee2f05. --- browser/components/MarkdownPreview.js | 8 ++++---- browser/lib/consts.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index 5cc4eca8..7a1f6815 100644 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -170,10 +170,10 @@ export default class MarkdownPreview extends React.Component { } setCodeTheme (theme) { - const pathToCss = consts.THEMES.some((_theme) => _theme === theme) - ? `theme/${theme}.css` - : 'lib/codemirror.css' - this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/${pathToCss}` + theme = consts.THEMES.some((_theme) => _theme === theme) + ? theme + : 'default' + this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/theme/${theme}.css` } rewriteIframe () { diff --git a/browser/lib/consts.js b/browser/lib/consts.js index fe108fd1..253bc974 100644 --- a/browser/lib/consts.js +++ b/browser/lib/consts.js @@ -30,7 +30,7 @@ const consts = { 'Dodger Blue', 'Violet Eggplant' ], - THEMES: themes, + THEMES: ['default'].concat(themes) } module.exports = consts