mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -47,13 +47,13 @@ const editDialog = (customName: string, customMemo: string) => {
|
||||
const customElement = dialog.element.querySelector("textarea");
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
dialog.bindInput(customElement, () => {
|
||||
(btnsElement[1] as HTMLButtonElement).click();
|
||||
(btnsElement[2] as HTMLButtonElement).click();
|
||||
});
|
||||
customElement.value = customMemo;
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
dialog.destroy();
|
||||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
btnsElement[2].addEventListener("click", () => {
|
||||
window.siyuan.storage[Constants.LOCAL_AI].find((subItem: {
|
||||
name: string,
|
||||
memo: string
|
||||
@@ -67,7 +67,7 @@ const editDialog = (customName: string, customMemo: string) => {
|
||||
});
|
||||
dialog.destroy();
|
||||
});
|
||||
btnsElement[2].addEventListener("click", () => {
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
window.siyuan.storage[Constants.LOCAL_AI].find((subItem: {
|
||||
name: string,
|
||||
memo: string
|
||||
|
||||
@@ -46,12 +46,12 @@ const editLayout = (layoutName?: string) => {
|
||||
inputElement.select();
|
||||
inputElement.focus();
|
||||
dialog.bindInput(inputElement, () => {
|
||||
btnsElement[1].dispatchEvent(new CustomEvent("click"));
|
||||
});
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
dialog.destroy();
|
||||
btnsElement[2].dispatchEvent(new CustomEvent("click"));
|
||||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
dialog.destroy();
|
||||
});
|
||||
btnsElement[2].addEventListener("click", () => {
|
||||
const value = inputElement.value;
|
||||
if (!value) {
|
||||
showMessage(window.siyuan.languages["_kernel"]["142"]);
|
||||
@@ -88,7 +88,7 @@ const editLayout = (layoutName?: string) => {
|
||||
});
|
||||
setStorageVal(Constants.LOCAL_LAYOUTS, window.siyuan.storage[Constants.LOCAL_LAYOUTS]);
|
||||
});
|
||||
btnsElement[2].addEventListener("click", () => {
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
window.siyuan.storage[Constants.LOCAL_LAYOUTS].find((layoutItem: ISaveLayout, index: number) => {
|
||||
if (layoutItem.name === layoutName) {
|
||||
window.siyuan.storage[Constants.LOCAL_LAYOUTS].splice(index, 1);
|
||||
|
||||
Reference in New Issue
Block a user