mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
Improved performance of swipe up (#9147)
This commit is contained in:
parent
ffd153d268
commit
111608fd37
1 changed files with 8 additions and 3 deletions
|
|
@ -157,10 +157,15 @@ const setHTML = (options: {
|
|||
protyle.scroll.lastScrollTop = protyle.contentElement.scrollTop;
|
||||
// 动态加载移除
|
||||
if (!protyle.wysiwyg.element.querySelector(".protyle-wysiwyg--select") && !protyle.scroll.keepLazyLoad) {
|
||||
while (protyle.wysiwyg.element.childElementCount > 2 && protyle.contentElement.scrollHeight > REMOVED_OVER_HEIGHT &&
|
||||
protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().top > window.innerHeight) {
|
||||
protyle.wysiwyg.element.lastElementChild.remove();
|
||||
const removeElements:HTMLElement[] = []
|
||||
if (protyle.wysiwyg.element.childElementCount > 2 && protyle.contentElement.scrollHeight > REMOVED_OVER_HEIGHT){
|
||||
protyle.wysiwyg.element.childNodes.forEach((el)=>{
|
||||
if((el as HTMLElement).getBoundingClientRect().top > window.innerHeight * 2){
|
||||
removeElements.push((el as HTMLElement))
|
||||
}
|
||||
})
|
||||
}
|
||||
removeElements.forEach((el)=>{el.remove()})
|
||||
hideElements(["toolbar"], protyle);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue