This commit is contained in:
Vanessa 2024-05-27 11:06:54 +08:00
parent 7577933461
commit 19079acfc3
4 changed files with 8 additions and 9 deletions

View file

@ -494,9 +494,9 @@ export const removeAttrViewColAnimation = (blockElement: Element, id: string) =>
export const duplicateCompletely = (protyle:IProtyle, nodeElement:HTMLElement) => {
fetchPost("/api/av/duplicateAttributeViewBlock", {avID: nodeElement.getAttribute("data-av-id")}, (response) => {
nodeElement.classList.remove("protyle-wysiwyg--select")
nodeElement.classList.remove("protyle-wysiwyg--select");
const tempElement = document.createElement("template");
tempElement.innerHTML = protyle.lute.SpinBlockDOM(`<div data-node-id="${response.data.blockID}" data-av-id="${response.data.avID}" data-type="NodeAttributeView" data-av-type="table"></div>`)
tempElement.innerHTML = protyle.lute.SpinBlockDOM(`<div data-node-id="${response.data.blockID}" data-av-id="${response.data.avID}" data-type="NodeAttributeView" data-av-type="table"></div>`);
const cloneElement = tempElement.content.firstElementChild;
nodeElement.after(cloneElement);
avRender(cloneElement, protyle, () => {
@ -513,4 +513,4 @@ export const duplicateCompletely = (protyle:IProtyle, nodeElement:HTMLElement) =
id: response.data.blockID,
}]);
});
}
};

View file

@ -583,7 +583,7 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
link = aElement.getAttribute("data-href");
name = aElement.textContent;
} else {
const imgElement = tempElement.content.querySelector('.img img');
const imgElement = tempElement.content.querySelector(".img img");
if (imgElement) {
imgSrc = imgElement.getAttribute("data-src");
}