mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-23 07:24:07 +01:00
🚨
This commit is contained in:
parent
c5d6f41805
commit
d332328726
4 changed files with 39 additions and 39 deletions
|
|
@ -27,7 +27,7 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {
|
|||
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
|
||||
if (item.parentElement.classList.contains("protyle-wysiwyg")) {
|
||||
const headerTop = item.offsetTop - 30 + 56; // 30 - 面包屑, 56 - tab+title
|
||||
const headerElement = item.querySelector(".av__row--header") as HTMLElement
|
||||
const headerElement = item.querySelector(".av__row--header") as HTMLElement;
|
||||
if (headerElement) {
|
||||
if (headerTop < element.scrollTop && headerTop + headerElement.parentElement.clientHeight > element.scrollTop) {
|
||||
headerElement.style.transform = `translateY(${element.scrollTop - headerTop}px)`;
|
||||
|
|
@ -35,9 +35,9 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {
|
|||
headerElement.style.transform = "";
|
||||
}
|
||||
}
|
||||
const footerElement = item.querySelector(".av__row--footer") as HTMLElement
|
||||
const footerElement = item.querySelector(".av__row--footer") as HTMLElement;
|
||||
if (footerElement) {
|
||||
const footerBottom = headerTop + footerElement.parentElement.clientHeight
|
||||
const footerBottom = headerTop + footerElement.parentElement.clientHeight;
|
||||
const scrollBottom = element.scrollTop + element.clientHeight;
|
||||
if (headerTop + 42 + 36 * 2 < scrollBottom && footerBottom > scrollBottom) {
|
||||
footerElement.style.transform = `translateY(${scrollBottom - footerBottom}px)`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue