mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
This commit is contained in:
parent
543355f657
commit
0bbd9699b0
4 changed files with 23 additions and 8 deletions
|
|
@ -317,6 +317,7 @@
|
|||
border-radius: var(--b3-border-radius) var(--b3-border-radius) 0 0;
|
||||
overflow: hidden;
|
||||
transition: background 100ms ease-out;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&-img {
|
||||
|
|
@ -330,11 +331,21 @@
|
|||
}
|
||||
|
||||
&-content {
|
||||
white-space: break-spaces;
|
||||
word-break: break-word;
|
||||
margin: 8px 8px 0;
|
||||
font-size: 12px;
|
||||
color: var(--b3-theme-on-surface);
|
||||
transform: scale(0.85);
|
||||
left: 0;
|
||||
right: 0;
|
||||
transform-origin: 0 0;
|
||||
|
||||
& ~ div {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-fields {
|
||||
|
|
|
|||
|
|
@ -2283,7 +2283,7 @@ export class Gutter {
|
|||
let hideParent = false;
|
||||
while (nodeElement) {
|
||||
let parentElement = hasClosestBlock(nodeElement.parentElement);
|
||||
if (!isInEmbedBlock(nodeElement) && !isInAVBlock(nodeElement)) {
|
||||
if (!isInEmbedBlock(nodeElement)) {
|
||||
let type;
|
||||
if (!hideParent) {
|
||||
type = nodeElement.getAttribute("data-type");
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@ export const renderGallery = (options: {
|
|||
galleryHTML += `<div class="av__gallery-item${selectItemIds.includes(item.id) ? " av__gallery-item--select" : ""}">`;
|
||||
if (view.coverFrom !== 0) {
|
||||
if (item.coverURL) {
|
||||
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-img${view.fitImage ? " av__gallery-img--fit" : ""}" style="background-image:url('${item.coverURL}')"></div></div>`;
|
||||
if (item.coverURL.startsWith("background")) {
|
||||
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-img${view.fitImage ? " av__gallery-img--fit" : ""}" style="${item.coverURL}"></div></div>`;
|
||||
} else {
|
||||
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-img${view.fitImage ? " av__gallery-img--fit" : ""}" style="background-image:url('${item.coverURL}')"></div></div>`;
|
||||
}
|
||||
} else if (item.coverContent) {
|
||||
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-content">${item.coverContent}</div></div>`;
|
||||
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-content">${item.coverContent}</div><div></div></div>`;
|
||||
} else {
|
||||
galleryHTML += `<div class="av__gallery-cover"></div>`;
|
||||
galleryHTML += '<div class="av__gallery-cover"></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ export const isInEmbedBlock = (element: Element) => {
|
|||
};
|
||||
|
||||
export const isInAVBlock = (element: Element) => {
|
||||
if (hasClosestByClassName(element, 'av__gallery-cover')) {
|
||||
if (hasClosestByClassName(element, "av__gallery-cover")) {
|
||||
return hasClosestByClassName(element, "av");
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue