💄 加载更多和 resize 时需要调整数据库视图表头和尾

This commit is contained in:
Vanessa 2023-12-10 12:10:25 +08:00
parent b6a4566670
commit 2e63c1f0c8
2 changed files with 10 additions and 0 deletions

View file

@ -128,6 +128,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
event.stopPropagation();
return true;
} else if (type === "av-load-more") {
(blockElement.querySelector(".av__row--footer") as HTMLElement).style.transform = "";
blockElement.removeAttribute("data-render");
blockElement.dataset.pageSize = (parseInt(blockElement.dataset.pageSize) + parseInt(blockElement.querySelector('[data-type="set-page-size"]').getAttribute("data-size"))).toString();
avRender(blockElement, protyle);

View file

@ -3,6 +3,7 @@ import {setPadding} from "../ui/initUI";
import {hasClosestBlock} from "./hasClosest";
import {Constants} from "../../constants";
import {lineNumberRender} from "../render/highlightRender";
import {stickyRow} from "../render/av/row";
export const resize = (protyle: IProtyle) => {
hideElements(["gutter"], protyle);
@ -10,6 +11,14 @@ export const resize = (protyle: IProtyle) => {
const MIN_ABS = 4;
// 不能 clearTimeout否则 split 时左侧无法 resize
setTimeout(() => {
if(!protyle.disabled) {
const contentRect = protyle.contentElement.getBoundingClientRect();
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
if (item.querySelector(".av__title")) {
stickyRow(item, contentRect, "all");
}
});
}
if (abs.width > MIN_ABS || isNaN(abs.width)) {
if (typeof window.echarts !== "undefined") {
protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"], [data-subtype="mindmap"]').forEach((chartItem: HTMLElement) => {