Vanessa 2023-05-08 21:00:41 +08:00
parent 875f00398e
commit 99725ea21d
14 changed files with 122 additions and 40 deletions

View file

@ -9,6 +9,7 @@ import {MenuItem} from "../menus/Menu";
import {setMode} from "../util/assets";
import {openSetting} from "../config";
import {openSearch} from "../search/spread";
import {App} from "../index";
export const updateEditModeElement = () => {
const target = document.querySelector("#barReadonly");
@ -23,7 +24,7 @@ export const updateEditModeElement = () => {
}
};
export const initBar = () => {
export const initBar = (app: App) => {
const toolbarElement = document.getElementById("toolbar");
toolbarElement.innerHTML = `
<div id="barWorkspace" class="toolbar__item">
@ -68,7 +69,7 @@ export const initBar = () => {
event.stopPropagation();
break;
} else if (target.id === "barWorkspace") {
workspaceMenu(target.getBoundingClientRect());
workspaceMenu(app, target.getBoundingClientRect());
event.stopPropagation();
break;
} else if (target.id === "barReadonly") {
@ -113,7 +114,7 @@ export const initBar = () => {
break;
} else if (target.id === "toolbarVIP") {
if (!window.siyuan.config.readonly) {
const dialogSetting = openSetting();
const dialogSetting = openSetting(app);
dialogSetting.element.querySelector('.b3-tab-bar [data-name="account"]').dispatchEvent(new CustomEvent("click"));
}
event.stopPropagation();