Vanessa 2023-01-14 11:22:04 +08:00
parent a223c1b2a3
commit ef9c5450e8
2 changed files with 5 additions and 2 deletions

View file

@ -170,7 +170,8 @@ export class Protyle {
id: options.blockId, id: options.blockId,
k: options.key || "", k: options.key || "",
isBacklink: mergedOptions.action.includes(Constants.CB_GET_BACKLINK), 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, size: mergedOptions.action?.includes(Constants.CB_GET_ALL) ? Constants.SIZE_GET_MAX : window.siyuan.config.editor.dynamicLoadBlocks,
}, getResponse => { }, getResponse => {
onGet(getResponse, this.protyle, mergedOptions.action, options.scrollAttr); onGet(getResponse, this.protyle, mergedOptions.action, options.scrollAttr);

View file

@ -67,7 +67,9 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {
}); });
}, Constants.TIMEOUT_BLOCKLOAD); }, 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; return;
} }
if (protyle.scroll.lastScrollTop - element.scrollTop > 0) { if (protyle.scroll.lastScrollTop - element.scrollTop > 0) {