mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-10 06:32:33 +01:00
This commit is contained in:
parent
d9d3db1920
commit
ccdcecec14
1 changed files with 6 additions and 4 deletions
|
|
@ -28,10 +28,12 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {
|
||||||
if (item.parentElement.classList.contains("protyle-wysiwyg")) {
|
if (item.parentElement.classList.contains("protyle-wysiwyg")) {
|
||||||
const headerTop = item.offsetTop - 30 + 56
|
const headerTop = item.offsetTop - 30 + 56
|
||||||
const headerElement = item.querySelector(".av__row--header") as HTMLElement
|
const headerElement = item.querySelector(".av__row--header") as HTMLElement
|
||||||
if (headerTop < element.scrollTop && headerTop + headerElement.parentElement.clientHeight > element.scrollTop) {
|
if (headerElement) {
|
||||||
headerElement.style.transform = `translateY(${element.scrollTop - headerTop}px)`;
|
if (headerTop < element.scrollTop && headerTop + headerElement.parentElement.clientHeight > element.scrollTop) {
|
||||||
} else {
|
headerElement.style.transform = `translateY(${element.scrollTop - headerTop}px)`;
|
||||||
headerElement.style.transform = "";
|
} else {
|
||||||
|
headerElement.style.transform = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue