mirror of
https://codeberg.org/kirche-im-netz/Startodon-Hub.git
synced 2025-07-19 18:34:27 +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({
|
const popup = createPopup({
|
||||||
title: 'Erstelle dein StarterPack',
|
title: 'Erstelle dein StarterPack',
|
||||||
body: getStarterKitPopupContent(),
|
body: getStarterKitPopupContent(),
|
||||||
closeCallback: () => document.body.classList.remove('body-no-scroll'),
|
closeCallback: () => document.documentElement.classList.remove('html-no-scroll'),
|
||||||
customClass: 'starterkit-popup'
|
customClass: 'starterkit-popup'
|
||||||
});
|
});
|
||||||
|
|
||||||
document.body.classList.add('body-no-scroll');
|
document.documentElement.classList.add('html-no-scroll');
|
||||||
|
|
||||||
setupFormEvents(popup);
|
setupFormEvents(popup);
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function createPopup({ title, body, footer = '', customClass = '' }) {
|
||||||
document.body.appendChild(popup);
|
document.body.appendChild(popup);
|
||||||
|
|
||||||
// Scrollen deaktivieren
|
// Scrollen deaktivieren
|
||||||
document.body.classList.add('body-no-scroll');
|
document.documentElement.classList.add('html-no-scroll');
|
||||||
|
|
||||||
// Event-Listener für Schließen-Button
|
// Event-Listener für Schließen-Button
|
||||||
const closeButton = popup.querySelector('.close-popup');
|
const closeButton = popup.querySelector('.close-popup');
|
||||||
|
@ -45,7 +45,7 @@ export function closePopup(popup) {
|
||||||
popup.remove();
|
popup.remove();
|
||||||
|
|
||||||
// Scrollen wieder aktivieren
|
// Scrollen wieder aktivieren
|
||||||
document.body.classList.remove('body-no-scroll');
|
document.documentElement.classList.remove('html-no-scroll');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function destroyAllPopups() {
|
export function destroyAllPopups() {
|
||||||
|
@ -53,5 +53,5 @@ export function destroyAllPopups() {
|
||||||
document.querySelectorAll('.popup').forEach(popup => popup.remove());
|
document.querySelectorAll('.popup').forEach(popup => popup.remove());
|
||||||
|
|
||||||
// Scrollen wieder aktivieren
|
// 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);
|
infoTile.appendChild(descriptionElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.classList.add('body-no-scroll');
|
document.documentElement.classList.add('html-no-scroll');
|
||||||
history.pushState({ popupOpen: true }, null, '');
|
history.pushState({ popupOpen: true }, null, '');
|
||||||
|
|
||||||
// Event-Listener für den "Zurück"-Button hinzufügen
|
// 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) {
|
function closePopup(popup, onPopState) {
|
||||||
popup.remove();
|
popup.remove();
|
||||||
document.body.classList.remove('body-no-scroll');
|
document.documentElement.classList.remove('html-no-scroll');
|
||||||
window.removeEventListener('popstate', onPopState);
|
window.removeEventListener('popstate', onPopState);
|
||||||
history.back();
|
history.back();
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
background: #c82333;
|
background: #c82333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.body-no-scroll {
|
.html-no-scroll {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue