Skip to content

Commit

Permalink
🎨 fix #7036
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 12, 2023
1 parent 137b437 commit 1c90c34
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/menus/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class Menu {
this.element.classList.add("fn__none");
this.element.classList.remove("b3-menu--list");
this.element.removeAttribute("style"); // zIndex
window.siyuan.menus.menu.element.removeAttribute("data-name"); // 标识再次点击不消失
}

public append(element?: HTMLElement) {
Expand Down
6 changes: 6 additions & 0 deletions app/src/menus/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ import {openCard} from "../card/openCard";
import {showMessage} from "../dialog/message";

export const workspaceMenu = (rect: DOMRect) => {
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
window.siyuan.menus.menu.element.getAttribute("data-name") === "barWorkspace") {
window.siyuan.menus.menu.remove();
return;
}
window.siyuan.menus.menu.remove();
window.siyuan.menus.menu.element.setAttribute("data-name", "barWorkspace");
fetchPost("/api/system/getWorkspaces", {}, (response) => {
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.dataHistory,
Expand Down
6 changes: 6 additions & 0 deletions app/src/util/onGetConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,13 @@ const initBar = () => {
event.stopPropagation();
break;
} else if (target.id === "barMode") {
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
window.siyuan.menus.menu.element.getAttribute("data-name") === "barmode") {
window.siyuan.menus.menu.remove();
return;
}
window.siyuan.menus.menu.remove();
window.siyuan.menus.menu.element.setAttribute("data-name", "barmode");
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.themeLight,
icon: "iconLight",
Expand Down

0 comments on commit 1c90c34

Please sign in to comment.