mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 14:58:49 +01:00
This commit is contained in:
parent
8ef941001e
commit
3c00382811
2 changed files with 10 additions and 6 deletions
|
|
@ -104,8 +104,8 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex,
|
|||
});
|
||||
galleryHTML += `</div>
|
||||
<div class="av__gallery-actions">
|
||||
<span class="protyle-icon protyle-icon--first" data-type="av-gallery-edit"><svg><use xlink:href="#iconEdit"></use></svg></span>
|
||||
<span class="protyle-icon protyle-icon--last" data-type="av-gallery-more"><svg><use xlink:href="#iconMore"></use></svg></span>
|
||||
<span class="protyle-icon protyle-icon--first b3-tooltips b3-tooltips__n" aria-label="${window.siyuan.languages.displayEmptyFields}" data-type="av-gallery-edit"><svg><use xlink:href="#iconEdit"></use></svg></span>
|
||||
<span class="protyle-icon protyle-icon--last b3-tooltips b3-tooltips__n" aria-label="${window.siyuan.languages.more}" data-type="av-gallery-more"><svg><use xlink:href="#iconMore"></use></svg></span>
|
||||
</div>
|
||||
</div>`;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export const setGalleryCover = (options: {
|
|||
targetNameElement.textContent = window.siyuan.languages.contentImage;
|
||||
}
|
||||
});
|
||||
let addedSeparator = false
|
||||
let addedSeparator = false;
|
||||
options.view.fields.forEach(item => {
|
||||
if (item.type === "mAsset") {
|
||||
if (!addedSeparator) {
|
||||
|
|
@ -302,9 +302,13 @@ export const openGalleryItemMenu = (options: {
|
|||
});
|
||||
};
|
||||
|
||||
export const editGalleryItem = (taget: Element) => {
|
||||
const itemElement = hasClosestByClassName(taget, "av__gallery-item");
|
||||
export const editGalleryItem = (target: Element) => {
|
||||
const itemElement = hasClosestByClassName(target, "av__gallery-item");
|
||||
if (itemElement) {
|
||||
itemElement.querySelector(".av__gallery-fields")?.classList.toggle("av__gallery-fields--edit");
|
||||
const fieldsElement = itemElement.querySelector(".av__gallery-fields");
|
||||
if (fieldsElement) {
|
||||
target.setAttribute("aria-label", window.siyuan.languages[fieldsElement.classList.contains("av__gallery-fields--edit") ? "displayEmptyFields" : "hideEmptyFields"]);
|
||||
fieldsElement.classList.toggle("av__gallery-fields--edit");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue