1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

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

* prevent scroll-chaining in modals

* make body overflow hidden to prevent background scrolling
This commit is contained in:
Mario Pietsch 2021-06-27 17:24:06 +02:00 committed by GitHub
parent c9af04d0e5
commit a409536ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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

View File

@ -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