From cf866c85e392d8f8332f9e784d49e72abf00bbb2 Mon Sep 17 00:00:00 2001 From: tanknee Date: Fri, 2 Oct 2020 18:41:28 +0800 Subject: [PATCH] =?UTF-8?q?202001002=201.=20=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E7=AC=94=E8=AE=B0=E5=A4=A7=E7=BA=B2=E5=B1=82=E7=BA=A7=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=202.=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AC=94=E8=AE=B0copy=E5=88=B0Lite=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8mobile=E7=AB=AF=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/css/style.css | 9 ++------- src/store/server/actions.js | 2 +- src/utils/helper.js | 11 +++++------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/css/style.css b/src/css/style.css index 566893e..0fc39e0 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -43,20 +43,15 @@ body.body--dark { font-weight: bold; } .bg-blur { - /*webkit-filter: blur(10px); !* Chrome, Opera *!*/ - /*-moz-filter: blur(10px);*/ - /*-ms-filter: blur(10px);*/ - /*filter: blur(10px);*/ position: fixed; top: 0; bottom: 0; right: 0; z-index: 99; background-color: #fafafa; - backdrop-filter: blur(10px); - opacity: 0.8; + backdrop-filter: blur(8px); + opacity: 0.9; box-shadow: 0px 1px 16px 0px rgba(0, 0, 0, 0.31); - /*background: rgba(7, 7, 7, 0.6);*/ } .tooltip { font-size: 17px; diff --git a/src/store/server/actions.js b/src/store/server/actions.js index 4e415a0..1c334da 100644 --- a/src/store/server/actions.js +++ b/src/store/server/actions.js @@ -364,7 +364,7 @@ export default { title: isCurrentCategory ? `${title.replace(/\.md/, '')}-${i18n.t('duplicate')}${title.indexOf('.md') !== -1 ? '.md' : ''}` : title, owner: userId, html, - type + type: category === 'Lite' ? 'lite/markdown' : type } }) if (isCurrentCategory || helper.isNullOrEmpty(currentCategory)) { diff --git a/src/utils/helper.js b/src/utils/helper.js index d9b2554..d7643ca 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -245,12 +245,11 @@ function updateContentsList (editorRootElement) { if (list.length) { let target = list for (let j = 1; j < rank; j++) { - if (target.length === 0) { + if (target.length === 0 || rank === target[0].rank) { // target.push({ // key: `${i}-${j}`, // label: `${i}-${j}`, // children: [], - // open: true // }) break } else if (!target[target.length - 1].children) { @@ -263,8 +262,8 @@ function updateContentsList (editorRootElement) { key: `${i}-${rank}`, label: editorRootElement.children[i].innerText.replace(/^#+\s/, ''), element: editorRootElement.children[i], - open: true, - selectable: true + selectable: true, + rank: rank }) } else { // 处理第一个标题元素 @@ -274,12 +273,12 @@ function updateContentsList (editorRootElement) { if (j === rank - 1) { // 生成唯一key,整个编辑器中第i个元素的第j等级的标题 item.key = `${i}-${j}` - item.label = ' '.repeat(j) + editorRootElement.children[i].innerText.replace( + item.label = editorRootElement.children[i].innerText.replace( /^#+\s/, '' ) - item.open = true item.selectable = true + item.rank = rank item.element = editorRootElement.children[i] } // else {