Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/16936

Vanessa5a512e437a9a
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 5cdf2ae8dc..270c41763b 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -2338,9 +2338,9 @@ export class WYSIWYG {
hideTooltip();
// https://ld246.com/article/1648865235549
// 不能使用上一版本的 timeStamp,否则一直滚动将导致间隔不够 https://ld246.com/article/1662852664926
- 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") {
+ if (!preventGetTopHTML && !protyle.scroll.element.classList.contains("fn__none")) {
+ if (event.deltaY < 0 && protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") !== "1" &&
+ (protyle.contentElement.clientHeight === protyle.contentElement.scrollHeight || protyle.contentElement.scrollTop === 0)) {
fetchPost("/api/filetree/getDoc", {
id: protyle.wysiwyg.element.firstElementChild.getAttribute("data-node-id"),
mode: 1,
@@ -2353,7 +2353,10 @@ export class WYSIWYG {
action: [Constants.CB_GET_BEFORE, Constants.CB_GET_UNCHANGEID],
});
});
- } else if (event.deltaY > 0 && protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2") {
+ preventGetTopHTML = true;
+ } else if (event.deltaY > 0 && protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2" &&
+ (protyle.contentElement.clientHeight === protyle.contentElement.scrollHeight ||
+ protyle.contentElement.clientHeight + Math.ceil(protyle.contentElement.scrollTop) >= protyle.contentElement.scrollHeight)) {
fetchPost("/api/filetree/getDoc", {
id: protyle.wysiwyg.element.lastElementChild.getAttribute("data-node-id"),
mode: 2,
@@ -2366,8 +2369,8 @@ export class WYSIWYG {
action: [Constants.CB_GET_APPEND, Constants.CB_GET_UNCHANGEID],
});
});
+ preventGetTopHTML = true;
}
- preventGetTopHTML = true;
}
if (event.deltaX === 0) {
return;