From 19b9dd017e50014c2df7ca809c10ec2fc1a24ffa Mon Sep 17 00:00:00 2001 From: Sara Boutej <40363501+SaraBoutej@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:45:11 +0100 Subject: [PATCH] feat: Remove extra margin in stream page- MEED-2959 - Meeds-io/MIPs#103 (#3210) (cherry picked from commit 10b35eec6779e137a893d116e3dcc479b67d3a3f) (cherry picked from commit 4ae7c35a69913a6034daaa262607bb8cc39dd2f4) --- .../webapp/vue-apps/getting-started/main.js | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js b/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js index 645bc9e5b6c..9be4043f38c 100644 --- a/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js +++ b/webapp/portlet/src/main/webapp/vue-apps/getting-started/main.js @@ -9,16 +9,21 @@ export function hideGettingStarted() { }); } -const parentAppElement = document.querySelector('#GettingStartedPortlet .btClose'); +const parentAppElement = document.querySelector('#GettingStartedPortlet'); +const parentAppElementBtn = document.querySelector('#GettingStartedPortlet .btClose'); if (parentAppElement) { - parentAppElement.onclick = () => { - hideGettingStarted().then(() => { - const parentElementToHide = parentAppElement.closest('.PORTLET-FRAGMENT'); - hideGettingStarted().then(() => parentElementToHide.classList.add('hidden')); - }); - }; + if (parentAppElementBtn) { + parentAppElementBtn.onclick = () => { + hideGettingStarted().then(() => { + const parentElementToHide = parentAppElement.closest('.PORTLET-FRAGMENT'); + hideGettingStarted().then(() => parentElementToHide.classList.add('hidden')); + }); + }; + } +} else { + document.querySelector('#GettingStartedContainerChildren .PORTLET-FRAGMENT').classList.add('hidden'); } -const parentElementToHide = document.querySelector('#GettingStartedPortlet'); -if (parentElementToHide && parentElementToHide.dataset.canClose === 'true') { - parentElementToHide.closest('.PORTLET-FRAGMENT').classList.add('hidden'); + +if (parentAppElement && parentAppElement.dataset.canClose === 'true') { + parentAppElement.closest('.PORTLET-FRAGMENT').classList.add('hidden'); }