rename popup to refer to the new window generated

This commit is contained in:
buzz-lightsnack-2007 2024-04-28 16:58:48 +08:00
parent 5f3fd2dfb5
commit 809aa1c2d7
2 changed files with 15 additions and 27 deletions

View file

@ -0,0 +1,15 @@
import Window from "/scripts/GUI/window.js";
import BrowserIcon from '/scripts/GUI/extensionIcon.js';
export default class ManagedWindow {
constructor () {
this.instance = new Window("/pages/popup.htm", null, {"width": "120", "height": "200", "hidden": true});
}
/*
Show the popup.
*/
show() {
this.instance.show();
}
}

View file

@ -1,27 +0,0 @@
import Popup from "/scripts/GUI/popup.js";
export default class ManagedPopup {
constructor () {
this.instance = new Popup({"popup": "/pages/popup.htm", "hidden": true});
this.listener = chrome.runtime.onMessage.addListener(
(request, sender, sendResponse) => {
(request.action == "popup_open") ? this.enable() : this.disable();
}
);
}
/*
Enable the popup.
*/
enable() {
this.instance.enable();
}
/*
Close and disable the popup.
*/
disable() {
// Close the sidebar.
this.instance.disable();
}
}