mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
This commit is contained in:
parent
23e0c99dd7
commit
8383a4b3fa
1 changed files with 28 additions and 15 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue