From 06b4d8ea2651fca19f727dcc5a4ec91bc215a5b0 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 16 Nov 2022 23:09:20 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/6622 --- app/src/util/newFile.ts | 4 ++-- app/src/util/onGetConfig.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts index d18c626c3..ca08a68d0 100644 --- a/app/src/util/newFile.ts +++ b/app/src/util/newFile.ts @@ -1,6 +1,6 @@ import {showMessage} from "../dialog/message"; import {getAllModels} from "../layout/getAll"; -import {hasTopClosestByTag} from "../protyle/util/hasClosest"; +import {hasClosestByClassName, hasTopClosestByTag} from "../protyle/util/hasClosest"; import {getDockByType} from "../layout/util"; /// #if !MOBILE import {Files} from "../layout/dock/Files"; @@ -23,7 +23,7 @@ export const newFile = (notebookId?: string, currentPath?: string, open?: boolea if (currentElement.classList.contains("item--focus")) { notebookId = item.editor.protyle.notebookId; currentPath = pathPosix().dirname(item.editor.protyle.path); - if (currentElement.parentElement.parentElement.classList.contains("layout__wnd--active")) { + if (hasClosestByClassName(currentElement, "layout__wnd--active")) { return true; } } diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.ts index 5460b51a2..4d9d3cf20 100644 --- a/app/src/util/onGetConfig.ts +++ b/app/src/util/onGetConfig.ts @@ -191,7 +191,7 @@ const initBar = () => {
-
+
`; @@ -251,7 +251,7 @@ const initBar = () => { openSetting(); event.stopPropagation(); break; - } else if (target.id === "barHelp") { + } else if (target.id === "barTopHelp") { mountHelp(); event.stopPropagation(); break;