mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-09 14:12:34 +01:00
This commit is contained in:
parent
079917633c
commit
562d022b10
4 changed files with 11 additions and 7 deletions
|
|
@ -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();
|
||||
// 更新文档浏览时间
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue