diff --git a/scripts/GUI/builder/windowman.js b/scripts/GUI/builder/windowman.js index c76388d..a2a718b 100644 --- a/scripts/GUI/builder/windowman.js +++ b/scripts/GUI/builder/windowman.js @@ -195,24 +195,21 @@ export default class windowman { let target = {}; target[`source`] = button.getAttribute(`href`); target[`dimensions`] = {}; - target[`dimensions`][`height`] = (button.getAttribute(`tab-height`)) ? button.getAttribute(`tab-height`) + target[`dimensions`][`height`] = (button.getAttribute(`tab-height`)) ? parseInt(button.getAttribute(`tab-height`)) : null; - target[`dimensions`][`width`] = (button.getAttribute(`tab-width`)) ? button.getAttribute(`tab-width`) + target[`dimensions`][`width`] = (button.getAttribute(`tab-width`)) ? parseInt(button.getAttribute(`tab-width`)) : null; const event = function () { // Get the correct path. target[`path`] = ( !target[`source`].includes(`://`) - ? window.location.pathname - .split(`/`) - .slice(0, -1) - .join(`/`) - .concat(`/`) + ? window.location.pathname.split(`/`).slice(0, -1).join(`/`).concat(`/`) : `` ).concat(target[`source`]); - new Window(target[`path`], null, target[`dimensions`]); + // Open the window as a popup. + new Window(target[`path`], Object.assign(target[`dimensions`], {"type": "popup"})); }; button.addEventListener("click", event); diff --git a/scripts/GUI/entrypoints/ManagedWindow.js b/scripts/GUI/entrypoints/ManagedWindow.js index 7f6031f..925670e 100644 --- a/scripts/GUI/entrypoints/ManagedWindow.js +++ b/scripts/GUI/entrypoints/ManagedWindow.js @@ -1,9 +1,8 @@ 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}); + this.instance = new Window("/pages/popup.htm", {"width": "120", "height": "200", "type": "popup", "hidden": true}); } /*