mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This reverts commit 5862811d96.
This commit is contained in:
parent
5862811d96
commit
8eb5e53f81
6 changed files with 36 additions and 306 deletions
|
|
@ -7,7 +7,6 @@ import {unicode2Emoji} from "../../../emoji";
|
|||
import {focusBlock} from "../../util/selection";
|
||||
import {isMac} from "../../util/compatibility";
|
||||
import {hasClosestByClassName} from "../../util/hasClosest";
|
||||
import {avScroll} from "./scroll";
|
||||
|
||||
export const avRender = (element: Element, protyle: IProtyle, cb?: () => void) => {
|
||||
let avElements: Element[] = [];
|
||||
|
|
@ -42,6 +41,8 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void) =
|
|||
e.firstElementChild.innerHTML = html;
|
||||
}
|
||||
const left = e.querySelector(".av__scroll")?.scrollLeft || 0;
|
||||
const headerTransform = (e.querySelector(".av__row--header") as HTMLElement)?.style.transform;
|
||||
const footerTransform = (e.querySelector(".av__row--footer") as HTMLElement)?.style.transform;
|
||||
let selectCellId = "";
|
||||
const selectCellElement = e.querySelector(".av__cell--select") as HTMLElement;
|
||||
if (selectCellElement) {
|
||||
|
|
@ -221,7 +222,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
|||
<div class="av__counter fn__none"></div>
|
||||
</div>
|
||||
<div class="av__scroll">
|
||||
<div class="av__body">
|
||||
<div style="float: left;">
|
||||
${tableHTML}
|
||||
<div class="av__row--add">
|
||||
<div class="av__colsticky">
|
||||
|
|
@ -239,7 +240,12 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
|||
if (left) {
|
||||
e.querySelector(".av__scroll").scrollLeft = left;
|
||||
}
|
||||
avScroll(protyle.contentElement, e);
|
||||
if (headerTransform) {
|
||||
(e.querySelector(".av__row--header") as HTMLElement).style.transform = headerTransform;
|
||||
}
|
||||
if (footerTransform) {
|
||||
(e.querySelector(".av__row--footer") as HTMLElement).style.transform = footerTransform;
|
||||
}
|
||||
if (selectCellId) {
|
||||
const newCellElement = e.querySelector(`.av__row[data-id="${selectCellId.split(Constants.ZWSP)[0]}"] .av__cell[data-col-id="${selectCellId.split(Constants.ZWSP)[1]}"]`);
|
||||
if (newCellElement) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue