From 2e63c1f0c8af021139408a3421c60e9dae1646d0 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 10 Dec 2023 12:10:25 +0800 Subject: [PATCH] =?UTF-8?q?:lipstick:=20=E5=8A=A0=E8=BD=BD=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E5=92=8C=20resize=20=E6=97=B6=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E5=A4=B4=E5=92=8C=E5=B0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/render/av/action.ts | 1 + app/src/protyle/util/resize.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index bd8123bab..42f2c390e 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -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); diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts index 6dfe2e249..6a8189da2 100644 --- a/app/src/protyle/util/resize.ts +++ b/app/src/protyle/util/resize.ts @@ -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) => {