Vanessa 2025-11-22 19:43:41 +08:00
parent 079917633c
commit 562d022b10
4 changed files with 11 additions and 7 deletions

View file

@ -19,7 +19,7 @@ export const getCurrentEditor = () => {
return window.siyuan.mobile.popEditor || window.siyuan.mobile.editor;
};
export const openMobileFileById = (app: App, id: string, action: TProtyleAction[] = [Constants.CB_GET_HL]) => {
export const openMobileFileById = (app: App, id: string, action: TProtyleAction[] = [Constants.CB_GET_HL], scrollPosition?: ScrollLogicalPosition) => {
window.siyuan.storage[Constants.LOCAL_DOCINFO] = {id};
setStorageVal(Constants.LOCAL_DOCINFO, window.siyuan.storage[Constants.LOCAL_DOCINFO]);
const avPanelElement = document.querySelector(".av__panel");
@ -44,7 +44,7 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
if (action.includes(Constants.CB_GET_HL)) {
highlightById(window.siyuan.mobile.editor.protyle, id);
} else {
scrollCenter(window.siyuan.mobile.editor.protyle, blockElement);
scrollCenter(window.siyuan.mobile.editor.protyle, blockElement, scrollPosition);
}
closePanel();
// 更新文档浏览时间