add manager for popup entry points

This commit is contained in:
buzz-lightsnack-2007 2024-04-24 16:25:15 +08:00
parent a549cbe76a
commit ca15164def
4 changed files with 90 additions and 6 deletions

27
scripts/external/entries/menu.js vendored Normal file
View file

@ -0,0 +1,27 @@
import Menu from '/scripts/GUI/context_menus.js';
import texts from "/scripts/strings/read.js";
import ManagedSidebar from "./sidebar.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`], event: {"onClicked": MenuEntry.onclick}, hidden: true});
};
/*
Enable the sidebar.
*/
enable () {
this.menu.show();
}
/* Disable. */
disable () {
this.menu.remove();
}
static onclick() {
new ManagedSidebar();
};
}