Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/6828

Vanessa37b3520f8596
diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.ts
index 48f84cc57e..85447fbe80 100644
--- a/app/src/menus/Menu.ts
+++ b/app/src/menus/Menu.ts
@@ -124,8 +124,6 @@ export class MenuItem {
return;
}
options.click(this.element);
- this.element.parentElement.classList.add("fn__none");
- this.element.parentElement.innerHTML = "";
event.preventDefault();
event.stopImmediatePropagation();
event.stopPropagation();
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index a36726a885..78d80b0eb5 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -17,7 +17,7 @@ import {addLoading, setPadding} from "../protyle/ui/initUI";
import {getIconByType} from "../editor/getIcon";
import {unicode2Emoji} from "../emoji";
import {Dialog} from "../dialog";
-import {hasClosestByMatchTag} from "../protyle/util/hasClosest";
+import {hasClosestByClassName} from "../protyle/util/hasClosest";
export const openGlobalSearch = (text: string, replace: boolean) => {
text = text.trim();
@@ -720,7 +720,7 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
</div>`,
bind(menuElement) {
menuElement.addEventListener("click", (event) => {
- if (hasClosestByMatchTag(event.target as HTMLElement, "svg")) {
+ if (hasClosestByClassName(event.target as HTMLElement, "fn__a")) {
fetchPost("/api/storage/removeCriterion", {name: item.name.trim()});
event.preventDefault();
event.stopPropagation();
@@ -731,6 +731,12 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
}
return;
}
+ const dialogElement = hasClosestByClassName(element, "b3-dialog--open")
+ if (dialogElement && dialogElement.getAttribute("data-key") === window.siyuan.config.keymap.general.search.custom) {
+ // https://github.com/siyuan-note/siyuan/issues/6828
+ item.hPath = config.hPath;
+ item.idPath = config.idPath.join(",").split(",");
+ }
if (config.layout !== item.layout) {
if (item.layout === 0) {
element.querySelector(".search__layout").classList.remove("search__layout--row");