mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
ad1924890b
commit
37b3520f85
2 changed files with 8 additions and 4 deletions
|
|
@ -124,8 +124,6 @@ export class MenuItem {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
options.click(this.element);
|
options.click(this.element);
|
||||||
this.element.parentElement.classList.add("fn__none");
|
|
||||||
this.element.parentElement.innerHTML = "";
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import {addLoading, setPadding} from "../protyle/ui/initUI";
|
||||||
import {getIconByType} from "../editor/getIcon";
|
import {getIconByType} from "../editor/getIcon";
|
||||||
import {unicode2Emoji} from "../emoji";
|
import {unicode2Emoji} from "../emoji";
|
||||||
import {Dialog} from "../dialog";
|
import {Dialog} from "../dialog";
|
||||||
import {hasClosestByMatchTag} from "../protyle/util/hasClosest";
|
import {hasClosestByClassName} from "../protyle/util/hasClosest";
|
||||||
|
|
||||||
export const openGlobalSearch = (text: string, replace: boolean) => {
|
export const openGlobalSearch = (text: string, replace: boolean) => {
|
||||||
text = text.trim();
|
text = text.trim();
|
||||||
|
|
@ -720,7 +720,7 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
|
||||||
</div>`,
|
</div>`,
|
||||||
bind(menuElement) {
|
bind(menuElement) {
|
||||||
menuElement.addEventListener("click", (event) => {
|
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()});
|
fetchPost("/api/storage/removeCriterion", {name: item.name.trim()});
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
@ -731,6 +731,12 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
|
||||||
}
|
}
|
||||||
return;
|
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 (config.layout !== item.layout) {
|
||||||
if (item.layout === 0) {
|
if (item.layout === 0) {
|
||||||
element.querySelector(".search__layout").classList.remove("search__layout--row");
|
element.querySelector(".search__layout").classList.remove("search__layout--row");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue