diff --git a/src/components/create-starterpack-popup.js b/src/components/create-starterpack-popup.js index 6da92b8..1732b3a 100644 --- a/src/components/create-starterpack-popup.js +++ b/src/components/create-starterpack-popup.js @@ -10,11 +10,11 @@ export function initializeCreateStarterKitPopup() { const popup = createPopup({ title: 'Erstelle dein StarterPack', body: getStarterKitPopupContent(), - closeCallback: () => document.body.classList.remove('body-no-scroll'), + closeCallback: () => document.documentElement.classList.remove('html-no-scroll'), customClass: 'starterkit-popup' }); - document.body.classList.add('body-no-scroll'); + document.documentElement.classList.add('html-no-scroll'); setupFormEvents(popup); }); diff --git a/src/components/popupManager.js b/src/components/popupManager.js index 650df30..3119d28 100644 --- a/src/components/popupManager.js +++ b/src/components/popupManager.js @@ -21,7 +21,7 @@ export function createPopup({ title, body, footer = '', customClass = '' }) { document.body.appendChild(popup); // Scrollen deaktivieren - document.body.classList.add('body-no-scroll'); + document.documentElement.classList.add('html-no-scroll'); // Event-Listener für Schließen-Button const closeButton = popup.querySelector('.close-popup'); @@ -45,7 +45,7 @@ export function closePopup(popup) { popup.remove(); // Scrollen wieder aktivieren - document.body.classList.remove('body-no-scroll'); + document.documentElement.classList.remove('html-no-scroll'); } export function destroyAllPopups() { @@ -53,5 +53,5 @@ export function destroyAllPopups() { document.querySelectorAll('.popup').forEach(popup => popup.remove()); // Scrollen wieder aktivieren - document.body.classList.remove('body-no-scroll'); + document.documentElement.classList.remove('html-no-scroll'); } diff --git a/src/utils/recommendations-utils.js b/src/utils/recommendations-utils.js index ca1cba9..75d06fc 100644 --- a/src/utils/recommendations-utils.js +++ b/src/utils/recommendations-utils.js @@ -27,7 +27,7 @@ export function createRecommendationPopup(accounts, title, authors, description) infoTile.appendChild(descriptionElement); } - document.body.classList.add('body-no-scroll'); + document.documentElement.classList.add('html-no-scroll'); history.pushState({ popupOpen: true }, null, ''); // Event-Listener für den "Zurück"-Button hinzufügen @@ -95,7 +95,7 @@ export function createRecommendationPopup(accounts, title, authors, description) function closePopup(popup, onPopState) { popup.remove(); - document.body.classList.remove('body-no-scroll'); + document.documentElement.classList.remove('html-no-scroll'); window.removeEventListener('popstate', onPopState); history.back(); } diff --git a/style/popup.css b/style/popup.css index 114d164..5e502e5 100644 --- a/style/popup.css +++ b/style/popup.css @@ -112,7 +112,7 @@ background: #c82333; } -.body-no-scroll { +.html-no-scroll { overflow: hidden; }