mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-09 06:02: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
|
|
@ -51,6 +51,7 @@ export const saveExport = (option: IExportOptions) => {
|
|||
</div>`,
|
||||
width: "520px",
|
||||
});
|
||||
wordDialog.element.setAttribute("data-key", Constants.DIALOG_EXPORTWORD);
|
||||
const btnsElement = wordDialog.element.querySelectorAll(".b3-button");
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
wordDialog.destroy();
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ export const exportImage = (id: string) => {
|
|||
width: isMobile() ? "92vw" : "990px",
|
||||
height: "70vh"
|
||||
});
|
||||
exportDialog.element.setAttribute("data-key", Constants.DIALOG_EXPORTIMAGE);
|
||||
const btnsElement = exportDialog.element.querySelectorAll(".b3-button");
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
exportDialog.destroy();
|
||||
|
|
|
|||
|
|
@ -261,6 +261,7 @@ export class Background {
|
|||
width: isMobile() ? "92vw" : "912px",
|
||||
height: isMobile() ? "80vh" : "70vh",
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_BACKGROUNDRANDOM);
|
||||
dialog.element.addEventListener("click", (event) => {
|
||||
const target = event.target as HTMLElement;
|
||||
if (target.classList.contains("b3-card")) {
|
||||
|
|
@ -349,6 +350,7 @@ export class Background {
|
|||
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
|
||||
</div>`,
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_BACKGROUNDLINK);
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
dialog.destroy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue