diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index a847522b3..0ec36d62f 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2338,22 +2338,35 @@ export class WYSIWYG { hideTooltip(); // https://ld246.com/article/1648865235549 // 不能使用上一版本的 timeStamp,否则一直滚动将导致间隔不够 https://ld246.com/article/1662852664926 - if (!preventGetTopHTML && - event.deltaY < 0 && !protyle.scroll.element.classList.contains("fn__none") && - protyle.contentElement.clientHeight === protyle.contentElement.scrollHeight && - protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") !== "1") { - fetchPost("/api/filetree/getDoc", { - id: protyle.wysiwyg.element.firstElementChild.getAttribute("data-node-id"), - mode: 1, - size: window.siyuan.config.editor.dynamicLoadBlocks, - }, getResponse => { - preventGetTopHTML = false; - onGet({ - data: getResponse, - protyle, - action: [Constants.CB_GET_BEFORE, Constants.CB_GET_UNCHANGEID], + if (!preventGetTopHTML && !protyle.scroll.element.classList.contains("fn__none") && + protyle.contentElement.clientHeight === protyle.contentElement.scrollHeight) { + if (event.deltaY < 0 && protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") !== "1") { + fetchPost("/api/filetree/getDoc", { + id: protyle.wysiwyg.element.firstElementChild.getAttribute("data-node-id"), + mode: 1, + size: window.siyuan.config.editor.dynamicLoadBlocks, + }, getResponse => { + preventGetTopHTML = false; + onGet({ + data: getResponse, + protyle, + action: [Constants.CB_GET_BEFORE, Constants.CB_GET_UNCHANGEID], + }); }); - }); + } else if (event.deltaY > 0 && protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2") { + fetchPost("/api/filetree/getDoc", { + id: protyle.wysiwyg.element.firstElementChild.getAttribute("data-node-id"), + mode: 3, + size: window.siyuan.config.editor.dynamicLoadBlocks, + }, getResponse => { + preventGetTopHTML = false; + onGet({ + data: getResponse, + protyle, + action: [Constants.CB_GET_APPEND, Constants.CB_GET_UNCHANGEID], + }); + }); + } preventGetTopHTML = true; } if (event.deltaX === 0) {