From 020f55e8ca24475f45dbbbe2e0ffa0574b49f9bc Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:43:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=8F=98=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=20`=E6=B7=BB=E5=8A=A0=E6=9D=A1=E7=9B=AE`=20`=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A`=20=E6=8C=89=E9=92=AE=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9E=84=20(#13206)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update render.ts * Update render.ts * Update action.ts --- app/src/protyle/render/av/action.ts | 22 ++++++++++++---------- app/src/protyle/render/av/render.ts | 10 ++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index b6d5816d06e..907beb23c4a 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -43,6 +43,18 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle if (!blockElement) { return false; } + const setPageSizeElement = hasClosestByAttribute(event.target, "data-type", "set-page-size"); + if (setPageSizeElement) { + setPageSize({ + target: event.target, + protyle, + avID: blockElement.getAttribute("data-av-id"), + nodeElement: blockElement + }); + event.preventDefault(); + event.stopPropagation(); + return true; + } const loadMoreElement = hasClosestByAttribute(event.target, "data-type", "av-load-more"); if (loadMoreElement) { (blockElement.querySelector(".av__row--footer") as HTMLElement).style.transform = ""; @@ -181,16 +193,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle event.preventDefault(); event.stopPropagation(); return true; - } else if (type === "set-page-size") { - setPageSize({ - target, - protyle, - avID: blockElement.getAttribute("data-av-id"), - nodeElement: blockElement - }); - event.preventDefault(); - event.stopPropagation(); - return true; } else if (type === "av-add-bottom") { insertRows(blockElement, protyle, 1, blockElement.querySelector(".av__row--util").previousElementSibling.getAttribute("data-id") || ""); event.preventDefault(); diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index 724b08d3795..5b83be19d15 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -264,14 +264,12 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
-