mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 22:44:06 +01:00
Add attribute "data-key" for Dialog (#10138)
This commit is contained in:
parent
b669d1a19c
commit
291211bd00
29 changed files with 103 additions and 0 deletions
|
|
@ -113,6 +113,7 @@ export const newNotebook = () => {
|
|||
</div>`,
|
||||
width: isMobile() ? "92vw" : "520px"
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_CREATENOTEBOOK);
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
dialog.bindInput(dialog.element.querySelector("input"), () => {
|
||||
btnsElement[1].dispatchEvent(new CustomEvent("click"));
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export const renameTag = (labelName: string) => {
|
|||
</div>`,
|
||||
width: isMobile() ? "92vw": "520px",
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_RENAMETAG);
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
dialog.destroy();
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void,
|
|||
}
|
||||
}
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_MOVEPATHTO);
|
||||
if (paths && paths.length > 0) {
|
||||
fetchPost("/api/filetree/getHPathsByPaths", {paths}, (response) => {
|
||||
dialog.element.querySelector(".b3-dialog__header .ft__smaller").innerHTML = escapeHtml(response.data.join(" "));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue