diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index 218fbf6a9..dd95245d0 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -81,8 +81,8 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}`; tableHTML += "
"; }); let tabHTML = "" - response.data.views.forEach((item:IAVView) => { - tabHTML +=`
+ response.data.views.forEach((item: IAVView) => { + tabHTML += `
${item.name}
` @@ -141,7 +141,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => { } lastElement = protyle.contentElement; lastParentID = operation.parentID; - const avId = operation.avID; + const avId = operation.avID; if (operation.action === "addAttrViewCol") { Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => { item.removeAttribute("data-render"); diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 37c6ff2e3..9db42f0f9 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -353,6 +353,7 @@ export class WYSIWYG { return; } const avId = nodeElement.getAttribute("data-av-id"); + const viewId = (nodeElement.querySelector(".item--focus") as HTMLElement).dataset.id; const dragElement = target.parentElement; const oldWidth = dragElement.clientWidth; const dragColId = dragElement.getAttribute("data-col-id"); @@ -373,12 +374,14 @@ export class WYSIWYG { transaction(protyle, [{ action: "setAttrViewColWidth", id: dragColId, - parentID: avId, + avID: avId, + viewID: viewId, data: newWidth }], [{ action: "setAttrViewColWidth", id: dragColId, - parentID: avId, + avID: avId, + viewID: viewId, data: oldWidth + "px" }]); };