Skip to content

Commit e16ad28

Browse files
committed
🎨 Improve #commonMenu menu
fix siyuan-note#16141
1 parent 894049e commit e16ad28

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export abstract class Constants {
228228
public static readonly MENU_BAR_WORKSPACE = "barWorkspace"; // 顶栏主菜单
229229
public static readonly MENU_BAR_PLUGIN = "topBarPlugin"; // 顶栏插件菜单
230230
public static readonly MENU_BAR_ZOOM = "barZoom"; // 顶栏缩放菜单
231-
public static readonly MENU_BAR_MORE = "barmore"; // 顶栏外观菜单
231+
public static readonly MENU_BAR_MODE = "barmode"; // 顶栏外观菜单
232232
public static readonly MENU_STATUS_HELP = "statusHelp"; // 状态栏帮助菜单
233233
public static readonly MENU_STATUS_BACKGROUND_TASK = "statusBackgroundTask"; // 状态栏后台任务菜单
234234
public static readonly MENU_DOCK_MOBILE = "dockMobileMenu"; // 移动端侧栏插件选项菜单

app/src/layout/topBar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ export const initBar = (app: App) => {
7575
break;
7676
} else if (targetId === "barMore") {
7777
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
78-
window.siyuan.menus.menu.element.getAttribute("data-name") === Constants.MENU_BAR_MORE) {
78+
window.siyuan.menus.menu.element.getAttribute("data-name") === Constants.MENU_BAR_MODE) {
7979
window.siyuan.menus.menu.remove();
8080
return;
8181
}
8282
window.siyuan.menus.menu.remove();
83-
window.siyuan.menus.menu.element.setAttribute("data-name", Constants.MENU_BAR_MORE);
83+
window.siyuan.menus.menu.element.setAttribute("data-name", Constants.MENU_BAR_MODE);
8484
(target.getAttribute("data-hideids") || "").split(",").forEach((itemId) => {
8585
const hideElement = toolbarElement.querySelector("#" + itemId);
8686
const useElement = hideElement.querySelector("use");
@@ -127,12 +127,12 @@ export const initBar = (app: App) => {
127127
break;
128128
} else if (targetId === "barMode") {
129129
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
130-
window.siyuan.menus.menu.element.getAttribute("data-name") === Constants.MENU_BAR_MORE) {
130+
window.siyuan.menus.menu.element.getAttribute("data-name") === Constants.MENU_BAR_MODE) {
131131
window.siyuan.menus.menu.remove();
132132
return;
133133
}
134134
window.siyuan.menus.menu.remove();
135-
window.siyuan.menus.menu.element.setAttribute("data-name", Constants.MENU_BAR_MORE);
135+
window.siyuan.menus.menu.element.setAttribute("data-name", Constants.MENU_BAR_MODE);
136136
window.siyuan.menus.menu.append(new MenuItem({
137137
id: "themeLight",
138138
label: window.siyuan.languages.themeLight,

0 commit comments

Comments
 (0)