This commit is contained in:
Vanessa 2022-06-27 21:37:58 +08:00
parent 9bc1711af8
commit bb6bad6120
2 changed files with 7 additions and 2 deletions

View file

@ -206,6 +206,7 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
if (!protyle.scroll.element.classList.contains("fn__none") &&
protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "true" &&
protyle.contentElement.scrollHeight > 0 && // 没有激活的页签 https://github.com/siyuan-note/siyuan/issues/5255
!options.action.includes(Constants.CB_GET_FOCUSFIRST) &&
protyle.contentElement.scrollHeight <= protyle.contentElement.clientHeight) {
fetchPost("/api/filetree/getDoc", {
id: protyle.wysiwyg.element.lastElementChild.getAttribute("data-node-id"),

View file

@ -492,10 +492,11 @@ export class WYSIWYG {
}
});
// https://github.com/siyuan-note/siyuan/issues/4099
let mousewheelTime = 0
this.element.addEventListener("mousewheel", (event: WheelEvent) => {
// https://ld246.com/article/1648865235549
if (event.deltaY < 0 && !protyle.scroll.element.classList.contains("fn__none") &&
if (event.timeStamp - mousewheelTime > 6000 &&
event.deltaY < 0 && !protyle.scroll.element.classList.contains("fn__none") &&
protyle.contentElement.clientHeight === protyle.contentElement.scrollHeight &&
protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") !== "true") {
fetchPost("/api/filetree/getDoc", {
@ -506,10 +507,13 @@ export class WYSIWYG {
}, getResponse => {
onGet(getResponse, protyle, [Constants.CB_GET_BEFORE, Constants.CB_GET_UNCHANGEID]);
});
mousewheelTime = 0;
}
mousewheelTime = event.timeStamp;
if (event.deltaX === 0) {
return;
}
// https://github.com/siyuan-note/siyuan/issues/4099
const tableElement = hasClosestByClassName(event.target as HTMLElement, "table");
if (tableElement) {
const tableSelectElement = tableElement.querySelector(".table__select") as HTMLElement;