Vanessa 2025-08-19 11:28:00 +08:00
parent dc90d05086
commit 462469c490
2 changed files with 8 additions and 3 deletions

View file

@ -21,7 +21,10 @@ export const insertGalleryItemAnimation = (options: {
const bodyElement = options.blockElement.querySelector(`.av__body[data-group-id="${options.groupID}"] `); const bodyElement = options.blockElement.querySelector(`.av__body[data-group-id="${options.groupID}"] `);
if (bodyElement && ["updated", "created"].includes(bodyElement.getAttribute("data-dtype")) && if (bodyElement && ["updated", "created"].includes(bodyElement.getAttribute("data-dtype")) &&
bodyElement.getAttribute("data-content") !== "_@today@_") { bodyElement.getAttribute("data-content") !== "_@today@_") {
sideItemElement = options.blockElement.querySelector('.av__body[data-content="_@today@_"] .av__gallery-add').previousElementSibling; sideItemElement = options.blockElement.querySelector('.av__body[data-content="_@today@_"] .av__gallery-add')?.previousElementSibling;
if (!sideItemElement) {
return;
}
} }
let cellsHTML = ""; let cellsHTML = "";
sideItemElement?.querySelectorAll(".av__cell").forEach((item: HTMLElement) => { sideItemElement?.querySelectorAll(".av__cell").forEach((item: HTMLElement) => {

View file

@ -130,9 +130,11 @@ export const insertAttrViewBlockAnimation = (options: {
const bodyElement = options.blockElement.querySelector(`.av__body[data-group-id="${options.groupID}"] `); const bodyElement = options.blockElement.querySelector(`.av__body[data-group-id="${options.groupID}"] `);
if (bodyElement && ["updated", "created"].includes(bodyElement.getAttribute("data-dtype")) && if (bodyElement && ["updated", "created"].includes(bodyElement.getAttribute("data-dtype")) &&
bodyElement.getAttribute("data-content") !== "_@today@_") { bodyElement.getAttribute("data-content") !== "_@today@_") {
previousElement = options.blockElement.querySelector('.av__body[data-content="_@today@_"] .av__row--util').previousElementSibling; previousElement = options.blockElement.querySelector('.av__body[data-content="_@today@_"] .av__row--util')?.previousElementSibling;
if (!previousElement) {
return;
}
} }
let cellsHTML = '<div class="av__colsticky"><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div></div>'; let cellsHTML = '<div class="av__colsticky"><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div></div>';
const pinIndex = previousElement.querySelectorAll(".av__colsticky .av__cell").length - 1; const pinIndex = previousElement.querySelectorAll(".av__colsticky .av__cell").length - 1;
if (pinIndex > -1) { if (pinIndex > -1) {