mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
Improve Menu for plugin (#9219)
* 🎨 Improve `Menu` for plugin
* Update Menu.ts
This commit is contained in:
parent
b902789aa4
commit
74dad4fc55
1 changed files with 3 additions and 0 deletions
|
|
@ -3,10 +3,13 @@ import {Menu as SiyuanMenu} from "../menus/Menu";
|
||||||
export class Menu {
|
export class Menu {
|
||||||
private menu: SiyuanMenu;
|
private menu: SiyuanMenu;
|
||||||
public isOpen: boolean;
|
public isOpen: boolean;
|
||||||
|
public element: HTMLElement;
|
||||||
|
|
||||||
constructor(id?: string, closeCB?: () => void) {
|
constructor(id?: string, closeCB?: () => void) {
|
||||||
this.menu = window.siyuan.menus.menu;
|
this.menu = window.siyuan.menus.menu;
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
|
this.element = this.menu.element;
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
const dataName = this.menu.element.getAttribute("data-name");
|
const dataName = this.menu.element.getAttribute("data-name");
|
||||||
if (dataName && dataName === id) {
|
if (dataName && dataName === id) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue