1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

change theme path usage and remove relative path

This commit is contained in:
AWolf81
2019-05-30 09:13:29 +02:00
committed by Junyoung Choi
parent bd52226ae2
commit 4af7106e01
3 changed files with 4 additions and 9 deletions

View File

@@ -677,11 +677,7 @@ export default class MarkdownPreview extends React.Component {
GetCodeThemeLink (name) {
const theme = consts.THEMES.find(theme => theme.name === name)
if (theme) {
return `${appPath}/${theme.path}`
} else {
return `${appPath}/node_modules/codemirror/theme/elegant.css`
}
return theme ? theme.path : `${appPath}/node_modules/codemirror/theme/elegant.css`
}
rewriteIframe () {

View File

@@ -110,7 +110,6 @@ function validate (config) {
}
function _save (config) {
console.log(config)
window.localStorage.setItem('config', JSON.stringify(config))
}
@@ -143,7 +142,7 @@ function get () {
const theme = consts.THEMES.find(theme => theme.name === config.editor.theme)
if (theme) {
editorTheme.setAttribute('href', `../${theme.path}`)
editorTheme.setAttribute('href', theme.path)
} else {
config.editor.theme = 'default'
}
@@ -191,7 +190,7 @@ function set (updates) {
const newTheme = consts.THEMES.find(theme => theme.name === newConfig.editor.theme)
if (newTheme) {
editorTheme.setAttribute('href', `../${newTheme.path}`)
editorTheme.setAttribute('href', newTheme.path)
}
ipcRenderer.send('config-renew', {

View File

@@ -135,7 +135,7 @@ class UiTab extends React.Component {
const theme = consts.THEMES.find(theme => theme.name === newCodemirrorTheme)
if (theme) {
checkHighLight.setAttribute('href', `../${theme.path}`)
checkHighLight.setAttribute('href', theme.path)
}
}