Prevent scrolling of the page when modals are displayed (#5816)

* prevent scroll-chaining in modals

* make body overflow hidden to prevent background scrolling
new-json-store-area
Mario Pietsch 2021-06-27 17:24:06 +02:00 zatwierdzone przez GitHub
rodzic c9af04d0e5
commit a409536ad0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -243,6 +243,7 @@ Modal.prototype.adjustPageClass = function() {
if(windowContainer) {
$tw.utils.toggleClass(windowContainer,"tc-modal-displayed",this.modalCount > 0);
}
$tw.utils.toggleClass(this.srcDocument.body,"tc-modal-prevent-scroll",this.modalCount > 0);
};
exports.Modal = Modal;

Wyświetl plik

@ -1,6 +1,6 @@
created: 20140912145537860
footer: <$button message="tm-close-tiddler">Close</$button>
modified: 20140912145537861
modified: 20210627054504823
subtitle: I'm a modal wizard
title: SampleWizard
type: text/vnd.tiddlywiki

Wyświetl plik

@ -1942,6 +1942,9 @@ html body.tc-body.tc-single-tiddler-window {
border-top: 1px solid <<colour modal-footer-border>>;
}
.tc-modal-prevent-scroll {
overflow: hidden;
}
/*
** Centered modals