Skip to content

Commit

Permalink
Update action.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC committed Nov 19, 2024
1 parent 40eb84a commit abf5baa
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/src/protyle/render/av/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit abf5baa

Please sign in to comment.