Skip to content

Commit

Permalink
🎨 桌面端支持同时打开多个工作空间 #4567
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 5, 2023
1 parent 7199b5b commit 04d59ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/dialog/processSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {Dialog} from "./index";
import {isMobile} from "../util/functions";
import {confirmDialog} from "./confirmDialog";
import {getCurrentWindow} from "@electron/remote";
import {pathPosix} from "../util/pathName";
import {originalPath} from "../util/pathName";

export const lockFile = (id: string) => {
const html = `<div class="b3-dialog__scrim"></div>
Expand Down Expand Up @@ -263,15 +263,15 @@ export const bootSync = () => {

export const setTitle = (title: string) => {
const dragElement = document.getElementById("drag");
const workspaceName = pathPosix().basename(window.siyuan.config.system.workspaceDir)
const workspaceName = originalPath().basename(window.siyuan.config.system.workspaceDir)
if (title === window.siyuan.languages.siyuanNote) {
const versionTitle =`${workspaceName} - ${title} v${Constants.SIYUAN_VERSION}`;
const versionTitle = `${title} - ${workspaceName} - v${Constants.SIYUAN_VERSION}`;
document.title = versionTitle;
dragElement.textContent = versionTitle;
dragElement.setAttribute("title", versionTitle);
} else {
title = title || "Untitled";
document.title =`${workspaceName} - ${title} - ${window.siyuan.languages.siyuanNote} v${Constants.SIYUAN_VERSION}`;
document.title = `${title} - ${workspaceName} - ${window.siyuan.languages.siyuanNote} v${Constants.SIYUAN_VERSION}`;
dragElement.textContent = title;
dragElement.setAttribute("title", title);
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/util/pathName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export const pathPosix = () => {
return path;
};

export const originalPath = () => {
return path;
};

export const getTopPaths = (liElements: Element[]) => {
const fromPaths: string[] = [];
liElements.forEach((item: HTMLElement) => {
Expand Down

0 comments on commit 04d59ef

Please sign in to comment.