This commit is contained in:
Vanessa 2023-11-22 16:47:41 +08:00
parent 82a0932102
commit 72752f441a
4 changed files with 10 additions and 1 deletions

View file

@ -49,6 +49,7 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRoot
fetchPost("/api/block/getDocInfo", {
id: window.siyuan.mobile.editor.protyle.block.rootID
}, (response) => {
setTitle(response.data.name);
(document.getElementById("toolbarName") as HTMLInputElement).value = response.data.name === "Untitled" ? "" : response.data.name;
});
}

View file

@ -12,6 +12,7 @@ import {closePanel} from "./closePanel";
import {showMessage} from "../../dialog/message";
import {getCurrentEditor} from "../editor";
import {avRender} from "../../protyle/render/av/render";
import {setTitle} from "../../dialog/processSystem";
const forwardStack: IBackStack[] = [];
@ -42,6 +43,7 @@ const focusStack = (backStack: IBackStack) => {
fetchPost("/api/block/getDocInfo", {
id: backStack.id,
}, (response) => {
setTitle(response.data.name);
(document.getElementById("toolbarName") as HTMLInputElement).value = response.data.name === "Untitled" ? "" : response.data.name;
protyle.background.render(response.data.ial, protyle.block.rootID);
protyle.wysiwyg.renderCustom(response.data.ial);

View file

@ -19,6 +19,7 @@ import {activeBlur, hideKeyboardToolbar, initKeyboardToolbar} from "./keyboardTo
import {syncGuide} from "../../sync/syncGuide";
import {Inbox} from "../../layout/dock/Inbox";
import {App} from "../../index";
import {setTitle} from "../../dialog/processSystem";
export const initFramework = (app: App, isStart: boolean) => {
setInlineStyle();
@ -162,5 +163,6 @@ const initEditorName = () => {
path: window.siyuan.mobile.editor.protyle.path,
title: inputElement.value,
});
setTitle(inputElement.value);
});
};

View file

@ -5,8 +5,10 @@ import {popSearch} from "../menu/search";
import {getRecentDocs} from "../menu/getRecentDocs";
import {openHistory} from "../../history/history";
import {App} from "../../index";
import {setTitle} from "../../dialog/processSystem";
export const setEmpty = (app: App) => {
setTitle(window.siyuan.languages.siyuanNote);
document.getElementById("toolbarName").classList.add("fn__hidden");
document.getElementById("editor").classList.add("fn__none");
const emptyElement = document.getElementById("empty");
@ -75,7 +77,9 @@ export const setEmpty = (app: App) => {
};
export const setEditor = () => {
document.getElementById("toolbarName").classList.remove("fn__hidden");
const toolbarNameElement = document.getElementById("toolbarName") as HTMLInputElement
setTitle(toolbarNameElement.value);
toolbarNameElement.classList.remove("fn__hidden");
document.getElementById("editor").classList.remove("fn__none");
document.getElementById("empty").classList.add("fn__none");
};