Vanessa 2024-09-18 12:16:58 +08:00
parent 816ebbc8cd
commit 9adb99364a
4 changed files with 4 additions and 15 deletions

View file

@ -594,7 +594,7 @@ export class Dock {
type: "pin",
tab,
blockId: editor?.protyle?.block?.rootID,
isPreview: !editor?.protyle?.preview?.element.classList.contains("fn__none")
isPreview: editor?.protyle?.preview ? editor.protyle.preview.element.classList.contains("fn__none") : false
});
if (editor?.protyle?.title?.editElement) {
outline.updateDocTitle(editor.protyle?.background?.ial);

View file

@ -58,17 +58,6 @@ export class MobileOutline {
}
public update() {
if (!window.siyuan.mobile.editor.protyle.preview.element.classList.contains("fn__none")) {
const blockId = window.siyuan.mobile.editor.protyle.preview.element.querySelector(".selected")?.id;
window.siyuan.mobile.editor.protyle.preview.render(window.siyuan.mobile.editor.protyle, (outlineData) => {
this.tree.updateData(outlineData);
if (blockId) {
this.setCurrentByPreview(this.element.querySelector("#" + blockId));
return;
}
});
return;
}
fetchPost("/api/outline/getDocOutline", {
id: window.siyuan.mobile.editor.protyle.block.rootID,
preview: !window.siyuan.mobile.editor.protyle.preview.element.classList.contains("fn__none")

View file

@ -191,9 +191,6 @@ export class Preview {
avRender(protyle.preview.previewElement, protyle);
speechRender(protyle.preview.previewElement, protyle.options.lang);
protyle.preview.previewElement.scrollTop = oldScrollTop;
/// #if !MOBILE
updateOutline(getAllModels(), protyle);
/// #endif
loadingElement.remove();
});
}, protyle.options.preview.delay);

View file

@ -16,6 +16,9 @@ export const setEditMode = (protyle: IProtyle, type: TEditorMode) => {
protyle.breadcrumb.toggleExit(true);
}
protyle.preview.render(protyle);
/// #if !MOBILE
updateOutline(getAllModels(), protyle, true);
/// #endif
} else if (type === "wysiwyg") {
if (!protyle.contentElement.classList.contains("fn__none")) {
return;