mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🎨
This commit is contained in:
parent
6782c8fa30
commit
4629e15f57
1 changed files with 4 additions and 4 deletions
|
|
@ -681,12 +681,12 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
|
||||||
const btnsElement = saveDialog.element.querySelectorAll(".b3-button");
|
const btnsElement = saveDialog.element.querySelectorAll(".b3-button");
|
||||||
saveDialog.bindInput(saveDialog.element.querySelector("input"), () => {
|
saveDialog.bindInput(saveDialog.element.querySelector("input"), () => {
|
||||||
btnsElement[1].dispatchEvent(new CustomEvent("click"));
|
btnsElement[1].dispatchEvent(new CustomEvent("click"));
|
||||||
})
|
});
|
||||||
btnsElement[0].addEventListener("click", () => {
|
btnsElement[0].addEventListener("click", () => {
|
||||||
saveDialog.destroy();
|
saveDialog.destroy();
|
||||||
});
|
});
|
||||||
btnsElement[1].addEventListener("click", () => {
|
btnsElement[1].addEventListener("click", () => {
|
||||||
let criterion = config;
|
const criterion = config;
|
||||||
criterion.name = saveDialog.element.querySelector("input").value;
|
criterion.name = saveDialog.element.querySelector("input").value;
|
||||||
fetchPost("/api/storage/setCriterion", {criterion}, () => {
|
fetchPost("/api/storage/setCriterion", {criterion}, () => {
|
||||||
saveDialog.destroy();
|
saveDialog.destroy();
|
||||||
|
|
@ -707,7 +707,7 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
|
||||||
menuElement.addEventListener("click", (event) => {
|
menuElement.addEventListener("click", (event) => {
|
||||||
if (hasClosestByMatchTag(event.target as HTMLElement, "svg")) {
|
if (hasClosestByMatchTag(event.target as HTMLElement, "svg")) {
|
||||||
fetchPost("/api/storage/removeCriterion", {name: item.name.trim()});
|
fetchPost("/api/storage/removeCriterion", {name: item.name.trim()});
|
||||||
window.siyuan.menus.menu.remove();
|
menuElement.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (config.layout !== item.layout) {
|
if (config.layout !== item.layout) {
|
||||||
|
|
@ -763,7 +763,7 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
|
||||||
Object.assign(config, item);
|
Object.assign(config, item);
|
||||||
inputEvent(element, config, undefined, edit);
|
inputEvent(element, config, undefined, edit);
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue