mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 05:32:33 +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
|
|
@ -125,6 +125,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
|||
</div>`,
|
||||
width: "520px",
|
||||
});
|
||||
createWorkspaceDialog.element.setAttribute("data-key", Constants.DIALOG_CREATEWORKSPACE);
|
||||
const inputElement = createWorkspaceDialog.element.querySelector("input");
|
||||
inputElement.focus();
|
||||
const btnsElement = createWorkspaceDialog.element.querySelectorAll(".b3-button");
|
||||
|
|
@ -159,6 +160,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
|||
</div>`,
|
||||
width: "520px",
|
||||
});
|
||||
openWorkspaceDialog.element.setAttribute("data-key", Constants.DIALOG_OPENWORKSPACE);
|
||||
const btnsElement = openWorkspaceDialog.element.querySelectorAll(".b3-button");
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
openWorkspaceDialog.destroy();
|
||||
|
|
@ -235,6 +237,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
|||
</div>`,
|
||||
width: "520px",
|
||||
});
|
||||
saveDialog.element.setAttribute("data-key", Constants.DIALOG_SAVEWORKSPACE);
|
||||
const btnsElement = saveDialog.element.querySelectorAll(".b3-button");
|
||||
saveDialog.bindInput(saveDialog.element.querySelector("input"), () => {
|
||||
btnsElement[1].dispatchEvent(new CustomEvent("click"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue