This commit is contained in:
Vanessa 2022-06-10 14:47:57 +08:00
parent 180c04a685
commit 59aae7c87b
2 changed files with 7 additions and 1 deletions

View file

@ -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")) {

View file

@ -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");