mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
This commit is contained in:
parent
875f00398e
commit
99725ea21d
14 changed files with 122 additions and 40 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue