This commit is contained in:
Vanessa 2022-06-24 16:10:27 +08:00
parent ac02cebfa6
commit 9e7ed1477b
2 changed files with 7 additions and 3 deletions

View file

@ -180,10 +180,10 @@ class Protyle {
});
}
});
if (mergedOptions.after) {
mergedOptions.after(this);
}
});
if (mergedOptions.after) {
mergedOptions.after(this);
}
}
public reload() {

View file

@ -663,6 +663,9 @@ const getArticle = (options: {
gutter: true,
breadcrumbDocName: true
},
after: (protyle) => {
protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`).scrollIntoView();
}
});
} else {
protyle.protyle.scroll.lastScrollTop = 0;
@ -674,6 +677,7 @@ const getArticle = (options: {
size: options.folded ? Constants.SIZE_GET_MAX : Constants.SIZE_GET,
}, getResponse => {
onGet(getResponse, protyle.protyle, options.folded ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL]);
protyle.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`).scrollIntoView();
});
}
};