修复内置手册无法使用自定义样式的bug

This commit is contained in:
fofolee 2019-05-10 00:37:41 +08:00
parent 887ede4673
commit a554570b5a
2 changed files with 3 additions and 3 deletions

View File

@ -159,7 +159,7 @@ utools.onPluginEnter( async ({ code, type, payload }) => {
switch (allFts[code].type) { switch (allFts[code].type) {
case "default": case "default":
baseDir = dirname; baseDir = dirname;
assetDir = `${baseDir}/assets/${code}/` assetDir = `${baseDir}/assets/${code}`
window.dirs = { window.dirs = {
idxFile: `${baseDir}/index/${code}.json`, idxFile: `${baseDir}/index/${code}.json`,
docPath: `${baseDir}/docs`, docPath: `${baseDir}/docs`,
@ -167,7 +167,7 @@ utools.onPluginEnter( async ({ code, type, payload }) => {
break; break;
case "custom": case "custom":
baseDir = allFts[code].path; baseDir = allFts[code].path;
assetDir = `${baseDir}/assets/` assetDir = `${baseDir}/assets`
window.dirs = { window.dirs = {
idxFile: `${baseDir}/${code}.json`, idxFile: `${baseDir}/${code}.json`,
docPath: `${baseDir}`, docPath: `${baseDir}`,
@ -183,7 +183,7 @@ utools.onPluginEnter( async ({ code, type, payload }) => {
if (!err) { if (!err) {
$('[href="assets/manual.css"]').remove(); $('[href="assets/manual.css"]').remove();
files.forEach(file => { files.forEach(file => {
$('head').append(`<link rel="stylesheet" href="${assetDir}${file}">`) $('head').append(`<link rel="stylesheet" href="${assetDir}/${file}">`)
}) })
} }
}) })

Binary file not shown.