Vanessa 2025-12-04 18:02:44 +08:00
parent bada8daa01
commit 73638be0c3
2 changed files with 6 additions and 2 deletions

View file

@ -104,7 +104,9 @@ export class MobileOutline extends Model {
}
} else {
checkFold(id, (zoomIn) => {
openMobileFileById(options.app, id, zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL, Constants.CB_GET_HTML, Constants.CB_GET_OUTLINE] : [Constants.CB_GET_HL, Constants.CB_GET_OUTLINE, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]);
openMobileFileById(options.app, id, zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL, Constants.CB_GET_HTML, Constants.CB_GET_OUTLINE] :
[Constants.CB_GET_HL, Constants.CB_GET_OUTLINE, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML],
"start");
});
}
},

View file

@ -42,7 +42,7 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
if (blockElement) {
pushBack();
if (action.includes(Constants.CB_GET_HL)) {
highlightById(window.siyuan.mobile.editor.protyle, id);
highlightById(window.siyuan.mobile.editor.protyle, id, scrollPosition);
} else {
scrollCenter(window.siyuan.mobile.editor.protyle, blockElement, scrollPosition);
}
@ -61,6 +61,7 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
const protyleOptions: IProtyleOptions = {
blockId: id,
rootId: data.data.rootID,
scrollPosition,
action,
render: {
scroll: true,
@ -105,6 +106,7 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
data: getResponse,
protyle: window.siyuan.mobile.editor.protyle,
action,
scrollPosition,
afterCB() {
app.plugins.forEach(item => {
item.eventBus.emit("switch-protyle", {protyle: window.siyuan.mobile.editor.protyle});