mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
This commit is contained in:
parent
180c04a685
commit
59aae7c87b
2 changed files with 7 additions and 1 deletions
|
|
@ -10,10 +10,14 @@ import {focusBlock} from "../protyle/util/selection";
|
|||
import {scrollCenter} from "../util/highlightById";
|
||||
import {lockFile} from "../dialog/processSystem";
|
||||
import {hasClosestByAttribute} from "../protyle/util/hasClosest";
|
||||
import {setEditMode} from "../protyle/util/setEditMode";
|
||||
|
||||
export const openMobileFileById = (id: string, hasContext?: boolean, action = [Constants.CB_GET_HL], pushStack = true) => {
|
||||
window.localStorage.setItem(Constants.LOCAL_DOCINFO, JSON.stringify({id, hasContext, action}));
|
||||
if (window.siyuan.mobileEditor) {
|
||||
if (window.siyuan.mobileEditor.protyle.contentElement.classList.contains("fn__none")) {
|
||||
setEditMode(window.siyuan.mobileEditor.protyle, "wysiwyg");
|
||||
}
|
||||
let blockElement;
|
||||
Array.from(window.siyuan.mobileEditor.protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${id}"]`)).find(item => {
|
||||
if (!hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed")) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ export const setEditMode = (protyle: IProtyle, type: TEditorMode) => {
|
|||
|
||||
protyle.preview.element.classList.add("fn__none");
|
||||
protyle.contentElement.classList.remove("fn__none");
|
||||
protyle.scroll?.element.classList.remove("fn__none");
|
||||
if (protyle.options.render.scroll) {
|
||||
protyle.scroll?.element.classList.remove("fn__none");
|
||||
}
|
||||
protyle.breadcrumb.element.classList.remove("fn__none");
|
||||
protyle.breadcrumb.element.nextElementSibling.classList.remove("fn__flex-1");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue