ShopAI-Extension/scripts/GUI/entrypoints/menuentry.js
2024-04-28 21:13:27 +08:00

24 lines
No EOL
497 B
JavaScript

import Menu from '/scripts/GUI/menus.js';
import texts from "/scripts/mapping/read.js";
export default class MenuEntry {
/* Create all entries. */
constructor() {
// Add the context menu.
this.menu = new Menu({title: (new texts(`entry_contextMenu`)).localized, contexts: [`all`], events: {"onClicked": this.onclick}, hidden: true});
};
/*
Enable the sidebar.
*/
enable () {
this.menu.show();
}
/*
Disable.
*/
disable () {
this.menu.remove();
}
}