From 8dc43cb22db3d44c62bafc0eefa0d1fd7f60150c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 30 May 2023 10:36:06 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8391 --- app/src/assets/scss/component/_card.scss | 15 ++++++ app/src/config/bazaar.ts | 67 +++++++++++------------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/app/src/assets/scss/component/_card.scss b/app/src/assets/scss/component/_card.scss index b4fa5237d..faf22f41e 100644 --- a/app/src/assets/scss/component/_card.scss +++ b/app/src/assets/scss/component/_card.scss @@ -46,6 +46,11 @@ &__info { padding: 16px 16px 4px; line-height: 18px; + + &--left { + padding-bottom: 16px; + padding-right: 8px; + } } &__desc { @@ -62,5 +67,15 @@ box-sizing: border-box; font-size: 12px; line-height: 14px; + + &--right { + padding-left: 0; + padding-bottom: 0; + align-items: center; + + .block__icon { + margin-left: 8px; + } + } } } diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts index 6a2eb6a80..497fac950 100644 --- a/app/src/config/bazaar.ts +++ b/app/src/config/bazaar.ts @@ -11,7 +11,7 @@ import * as path from "path"; /// #endif import {getFrontend, isBrowser} from "../util/functions"; import {setStorageVal} from "../protyle/util/compatibility"; -import {hasClosestByAttribute} from "../protyle/util/hasClosest"; +import {hasClosestByAttribute, hasClosestByClassName} from "../protyle/util/hasClosest"; import {Plugin} from "../plugin"; import {App} from "../index"; import {escapeAttr} from "../util/escape"; @@ -73,11 +73,11 @@ export const bazaar = { return `
${window.siyuan.languages.downloaded}
+
${window.siyuan.languages.plugin}
${window.siyuan.languages.theme}
${window.siyuan.languages.icon}
${window.siyuan.languages.template}
${window.siyuan.languages.widget}
-
${window.siyuan.languages.plugin}
@@ -85,15 +85,15 @@ export const bazaar = {
- + +
+
-
-
${loadingHTML} @@ -310,37 +310,32 @@ export const bazaar = { html += `
-
+
${item.preferredName} ${item.name}
${item.preferredDesc || ""}
-
- ${item.preferredFunding ? `` : ""} -
- ${item.incompatible ? `${window.siyuan.languages.incompatible}` : ""} - - - - - - - - - - - - - - - - - - - - - - -
+
+
+ ${item.incompatible ? `${window.siyuan.languages.incompatible}` : ""} + ${item.preferredFunding ? `` : ""} + + + + + + + + + + + + + + + + + +
`; }); @@ -489,7 +484,7 @@ export const bazaar = { }); return; } - this._genMyHTML("themes", app); + this._genMyHTML("plugins", app); bazaar.element.firstElementChild.addEventListener("click", (event) => { let target = event.target as HTMLElement; const dataElement = hasClosestByAttribute(target, "data-obj", null); @@ -739,7 +734,9 @@ export const bazaar = { event.stopPropagation(); break; } else if (target.classList.contains("b3-card")) { - bazaar._renderReadme(target, (dataObj.bazaarType) as TBazaarType); + if (!hasClosestByClassName(event.target as HTMLElement, "b3-card__actions--right")) { + bazaar._renderReadme(target, (dataObj.bazaarType) as TBazaarType); + } event.preventDefault(); event.stopPropagation(); break;