mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-01 18:30:16 +01:00
🎨 Lazy load marketplace package icons (#16979)
This commit is contained in:
parent
66aa94568e
commit
c717acaf5a
1 changed files with 4 additions and 4 deletions
|
|
@ -268,7 +268,7 @@ export const bazaar = {
|
|||
};
|
||||
return `<div data-obj='${JSON.stringify(dataObj)}' class="b3-card b3-card--wrap${hide ? " fn__none" : ""}${item.current ? " b3-card--current" : ""}">
|
||||
<div class="b3-card__img">
|
||||
<img src="${item.iconURL}" onerror="this.src='/stage/images/icon.png'"/>
|
||||
<img src="${item.iconURL}" loading="lazy" onerror="this.src='/stage/images/icon.png'"/>
|
||||
</div>
|
||||
<div class="fn__flex-1 fn__flex-column">
|
||||
<div class="b3-card__info fn__flex-1">
|
||||
|
|
@ -313,7 +313,7 @@ export const bazaar = {
|
|||
downloaded: true
|
||||
};
|
||||
return `<div class="b3-card" data-obj='${JSON.stringify(dataObj)}'>
|
||||
<div class="b3-card__img"><img src="${item.iconURL}" onerror="this.src='/stage/images/icon.png'"/></div>
|
||||
<div class="b3-card__img"><img src="${item.iconURL}" loading="lazy" onerror="this.src='/stage/images/icon.png'"/></div>
|
||||
<div class="fn__flex-1 fn__flex-column">
|
||||
<div class="b3-card__info b3-card__info--left fn__flex-1">
|
||||
${item.preferredName}${item.preferredName !== item.name ? ` <span class="ft__on-surface ft__smaller">${item.name}</span>` : ""}
|
||||
|
|
@ -422,7 +422,7 @@ export const bazaar = {
|
|||
});
|
||||
}
|
||||
html += `<div data-obj='${JSON.stringify(dataObj)}' class="b3-card${item.current ? " b3-card--current" : ""}${(window.siyuan.config.bazaar.petalDisabled && bazaarType === "plugins") ? " b3-card--disabled" : ""}">
|
||||
<div class="b3-card__img"><img src="${item.iconURL}" onerror="this.src='/stage/images/icon.png'"/></div>
|
||||
<div class="b3-card__img"><img src="${item.iconURL}" loading="lazy" onerror="this.src='/stage/images/icon.png'"/></div>
|
||||
<div class="fn__flex-1 fn__flex-column">
|
||||
<div class="b3-card__info b3-card__info--left fn__flex-1">
|
||||
${item.preferredName}${item.preferredName !== item.name ? ` <span class="ft__on-surface ft__smaller">${item.name}</span>` : ""}
|
||||
|
|
@ -515,7 +515,7 @@ type="checkbox">
|
|||
${navTitle}
|
||||
</div>
|
||||
</div>
|
||||
<img class="item__img" src="${data.iconURL}" onerror="this.src='/stage/images/icon.png'">
|
||||
<img class="item__img" src="${data.iconURL}" loading="lazy" onerror="this.src='/stage/images/icon.png'">
|
||||
<div>
|
||||
<a href="${data.repoURL}" target="_blank" class="item__title" title="GitHub Repo">${data.preferredName}</a>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue