From b1e76243573f6bb4c8a230af58de49dcfbf3ea77 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 8 Apr 2023 22:02:47 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/7932 --- app/src/card/openCard.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index 7c98b3291..05f67da91 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -44,8 +44,10 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
${window.siyuan.languages.riffCard} ${html} - ${isMobile() ? "" : `
-
+
+ ${isMobile() ? `
+ +
` : `
`}
@@ -100,8 +102,8 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
`, - width: isMobile() ? "98vw" : "80vw", - height: isMobile() ? "80vh" : "70vh", + width: isMobile() ? "100vw" : "80vw", + height: isMobile() ? "100vh" : "70vh", }); (dialog.element.querySelector(".b3-dialog__scrim") as HTMLElement).style.backgroundColor = "var(--b3-theme-background)"; (dialog.element.querySelector(".b3-dialog__container") as HTMLElement).style.maxWidth = "1024px"; @@ -142,6 +144,13 @@ export const openCardByData = (cardsData: ICard[], html = "") => { event.preventDefault(); return; } + const closeElement = hasClosestByAttribute(event.target as HTMLElement, "data-type", "close"); + if (closeElement) { + dialog.destroy(); + event.stopPropagation(); + event.preventDefault(); + return; + } let type = ""; if (typeof event.detail === "string") { if (event.detail === "1" || event.detail === "j") {