From 352d4ae26f7f97b5d8ce6def6f03655c63d86b07 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Tue, 21 May 2024 16:06:13 +0800 Subject: [PATCH] remove defining window size This is no longer necessary since a new tab is being created. --- scripts/GUI/builder/windowman.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/scripts/GUI/builder/windowman.js b/scripts/GUI/builder/windowman.js index 8f32a81..5dc1d07 100644 --- a/scripts/GUI/builder/windowman.js +++ b/scripts/GUI/builder/windowman.js @@ -258,17 +258,6 @@ export default class windowman { TARGET[`source`] = button.getAttribute(`href`); TARGET[`dimensions`] = {}; - // Get the dimensions of the window. - [`height`, `width`].forEach((DIMENSION) => { - TARGET[`dimensions`][DIMENSION] = (button.getAttribute(`tab-`.concat(DIMENSION))) - ? parseInt(button.getAttribute(`tab-`.concat(DIMENSION))) - : null; - - (button.getAttribute(`tab-`.concat(DIMENSION))) - ? button.removeAttribute(`tab-`.concat(DIMENSION)) - : false; - }) - // Get the path of the target. TARGET[`path`] = ( !URLs.test(TARGET[`source`]) @@ -276,12 +265,9 @@ export default class windowman { : `` ).concat(TARGET[`source`]); - // Set the event itself. - const event = () => { - // Open the window as a popup. - Tabs.create(TARGET[`path`]); - }; - button.addEventListener(`click`, event); + // When clicked, open the tab. + button.event = async () => {Tabs.create(TARGET[`path`]);}; + button.addEventListener(`click`, button.event); } }) : false;