mirror of
https://codeberg.org/kirche-im-netz/Startodon-Hub.git
synced 2025-06-21 00:26:08 +02:00
[PopUps] Scrollen im Hintergrund verhinern
This commit is contained in:
parent
0c82d183cb
commit
59f77e24b6
4 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
background: #c82333;
|
||||
}
|
||||
|
||||
.body-no-scroll {
|
||||
.html-no-scroll {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue