mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
c7962f1946
commit
15cce2c0a3
1 changed files with 4 additions and 2 deletions
|
|
@ -10,6 +10,7 @@ import {Dialog} from "./index";
|
||||||
import {isMobile} from "../util/functions";
|
import {isMobile} from "../util/functions";
|
||||||
import {confirmDialog} from "./confirmDialog";
|
import {confirmDialog} from "./confirmDialog";
|
||||||
import {getCurrentWindow} from "@electron/remote";
|
import {getCurrentWindow} from "@electron/remote";
|
||||||
|
import {pathPosix} from "../util/pathName";
|
||||||
|
|
||||||
export const lockFile = (id: string) => {
|
export const lockFile = (id: string) => {
|
||||||
const html = `<div class="b3-dialog__scrim"></div>
|
const html = `<div class="b3-dialog__scrim"></div>
|
||||||
|
|
@ -262,14 +263,15 @@ export const bootSync = () => {
|
||||||
|
|
||||||
export const setTitle = (title: string) => {
|
export const setTitle = (title: string) => {
|
||||||
const dragElement = document.getElementById("drag");
|
const dragElement = document.getElementById("drag");
|
||||||
|
const workspaceName = pathPosix().basename(window.siyuan.config.system.workspaceDir)
|
||||||
if (title === window.siyuan.languages.siyuanNote) {
|
if (title === window.siyuan.languages.siyuanNote) {
|
||||||
const versionTitle = title + " v" + Constants.SIYUAN_VERSION;
|
const versionTitle =`${workspaceName} - ${title} v${Constants.SIYUAN_VERSION}`;
|
||||||
document.title = versionTitle;
|
document.title = versionTitle;
|
||||||
dragElement.textContent = versionTitle;
|
dragElement.textContent = versionTitle;
|
||||||
dragElement.setAttribute("title", versionTitle);
|
dragElement.setAttribute("title", versionTitle);
|
||||||
} else {
|
} else {
|
||||||
title = title || "Untitled";
|
title = title || "Untitled";
|
||||||
document.title = title + " - " + window.siyuan.languages.siyuanNote + " v" + Constants.SIYUAN_VERSION;
|
document.title =`${workspaceName} - ${title} - ${window.siyuan.languages.siyuanNote} v${Constants.SIYUAN_VERSION}`;
|
||||||
dragElement.textContent = title;
|
dragElement.textContent = title;
|
||||||
dragElement.setAttribute("title", title);
|
dragElement.setAttribute("title", title);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue