Vanessa 2023-10-14 10:56:21 +08:00
parent 6b1a2925c9
commit 9ae8400b47
2 changed files with 2 additions and 2 deletions

View file

@ -355,7 +355,7 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => {
id,
data: blockElement.getAttribute("updated")
}]);
nameElement.setAttribute("updated", newUpdated);
blockElement.setAttribute("updated", newUpdated);
nameElement.dataset.title = newData;
blockElement.querySelector(".layout-tab-bar .item__text").textContent = newData;
};

View file

@ -252,7 +252,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
} else if (operation.action === "setAttrViewName") {
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {
const titleElement = item.querySelector(".av__title") as HTMLElement;
if (!titleElement || titleElement.textContent.trim() === operation.data) {
if (!titleElement) {
return;
}
titleElement.textContent = operation.data;