Vanessa 2024-04-24 20:03:56 +08:00
parent 92bc52c6ab
commit 421297d338
2 changed files with 21 additions and 6 deletions

View file

@ -170,12 +170,15 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
}
if (document.querySelector(".av__panel")) {
const cellElements: HTMLElement[] = [];
protyle.wysiwyg.element.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => {
if (getTypeByCellElement(item) === "mAsset") {
cellElements.push(item);
}
});
const cellElements: HTMLElement[] = [document.querySelector('.custom-attr__avvalue[data-type="mAsset"][data-active="true"]')];
if (!cellElements[0]) {
cellElements.splice(0, 1);
protyle.wysiwyg.element.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => {
if (getTypeByCellElement(item) === "mAsset") {
cellElements.push(item);
}
});
}
if (cellElements.length > 0) {
const blockElement = hasClosestBlock(cellElements[0]);
if (blockElement) {