diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts index 01263f06b..e7ad5f913 100644 --- a/app/src/protyle/index.ts +++ b/app/src/protyle/index.ts @@ -170,7 +170,8 @@ export class Protyle { id: options.blockId, k: options.key || "", isBacklink: mergedOptions.action.includes(Constants.CB_GET_BACKLINK), - mode: (mergedOptions.action && mergedOptions.action.includes(Constants.CB_GET_CONTEXT)) ? 3 : 0, // 0: 仅当前 ID(默认值),1:向上 2:向下,3:上下都加载,4:加载最后 + // 0: 仅当前 ID(默认值),1:向上 2:向下,3:上下都加载,4:加载最后 + mode: (mergedOptions.action && mergedOptions.action.includes(Constants.CB_GET_CONTEXT)) ? 3 : 0, size: mergedOptions.action?.includes(Constants.CB_GET_ALL) ? Constants.SIZE_GET_MAX : window.siyuan.config.editor.dynamicLoadBlocks, }, getResponse => { onGet(getResponse, this.protyle, mergedOptions.action, options.scrollAttr); diff --git a/app/src/protyle/scroll/event.ts b/app/src/protyle/scroll/event.ts index 10ae75e00..71f583633 100644 --- a/app/src/protyle/scroll/event.ts +++ b/app/src/protyle/scroll/event.ts @@ -67,7 +67,9 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => { }); }, Constants.TIMEOUT_BLOCKLOAD); } - if (protyle.wysiwyg.element.getAttribute("data-top") || protyle.block.showAll || protyle.scroll.lastScrollTop === element.scrollTop || protyle.scroll.lastScrollTop === -1) { + if (protyle.wysiwyg.element.getAttribute("data-top") || protyle.block.showAll || + (protyle.scroll && protyle.scroll.element.classList.contains("fn__none")) || !protyle.scroll || + protyle.scroll.lastScrollTop === element.scrollTop || protyle.scroll.lastScrollTop === -1) { return; } if (protyle.scroll.lastScrollTop - element.scrollTop > 0) {