rename popup to refer to the new window generated
This commit is contained in:
parent
5f3fd2dfb5
commit
809aa1c2d7
2 changed files with 15 additions and 27 deletions
15
scripts/GUI/entrypoints/ManagedWindow.js
Normal file
15
scripts/GUI/entrypoints/ManagedWindow.js
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue