diff --git a/scripts/GUI/entrypoints/manager.js b/scripts/GUI/entrypoints/manager.js index ce72c42..3dbba70 100644 --- a/scripts/GUI/entrypoints/manager.js +++ b/scripts/GUI/entrypoints/manager.js @@ -3,54 +3,56 @@ import Tabs from "/scripts/GUI/tabs.js"; import Window from "/scripts/GUI/window.js"; import MenuEntry from "./menu.js"; -import ManagedPopup from "./popup.js"; +import ManagedWindow from "./ManagedWindow.js"; import IconIndicator from "./icons.js"; import check from "/scripts/external/check.js"; import {read} from "/scripts/secretariat.js"; export default class EntryManager { - constructor () { - // Initialize the entries. - this.instances = {}; - this.instances.popup = new ManagedPopup(); - this.instances.menu = new MenuEntry(); + constructor () { + // Initialize the entries. + this.instances = {}; + this.instances.popup = new ManagedWindow(); + this.instances.menu = new MenuEntry(); - // Add the action listeners. - this.#listen(); - } + // Add the action listeners. + this.#listen(); + } - /* Add the action listeners when running this. */ - #listen() { - Tabs.addActionListener(`onActivated`, (data) => {this.onRefresh()}); - Tabs.addActionListener(`onUpdated`, (data) => {this.onRefresh()}); - Window.addActionListener(`onFocusChanged`, (data) => {this.onRefresh()}); - } + /* Add the action listeners. */ + #listen() { + Tabs.addActionListener(`onActivated`, (data) => {this.onRefresh()}); + Tabs.addActionListener(`onUpdated`, (data) => {this.onRefresh()}); + Window.addActionListener(`onFocusChanged`, (data) => {this.onRefresh()}); + + // Add the context menu event. + IconIndicator.set(this.instances.popup.show()); + this.instances.menu.menu.onclick(() => {this.instances.popup.show()}); + } - onRefresh() { - (Tabs.query(null, 0)).then((DATA) => { - if (DATA ? (DATA.url) : false) { - (check.platform(DATA.url)).then((result) => { - (result) ? (this.enable()) : (this.disable()) - }); - }; - }) - } + onRefresh() { + (Tabs.query(null, 0)).then((DATA) => { + if (DATA ? (DATA.url) : false) { + (check.platform(DATA.url)).then((result) => { + (result) ? (this.enable()) : (this.disable()) + }); + }; + }) + } - /* - Enable the entries. - */ - enable () { - this.instances.menu.enable(); - IconIndicator.enable(); - this.instances.popup.enable(); - } + /* + Enable the entries. + */ + enable () { + this.instances.menu.enable(); + IconIndicator.enable(); + } - /* - Disable the entries and the existing opened side panel. - */ - disable () { - this.instances.menu.disable(); - this.instances.popup.disable(); - IconIndicator.disable(); - } + /* + Disable the entries and the existing opened side panel. + */ + disable () { + this.instances.menu.disable(); + IconIndicator.disable(); + } } \ No newline at end of file