Prevent scroll when modal is up.

This commit is contained in:
Sage Vaillancourt 2022-10-02 09:57:17 -04:00
parent 577c911f34
commit a23ec07618
2 changed files with 6 additions and 0 deletions

View File

@ -417,4 +417,8 @@ textarea {
.hidden { .hidden {
display: none; display: none;
}
.scroll-lock {
overflow: hidden;
} }

View File

@ -9,10 +9,12 @@
<script type="text/javascript"> <script type="text/javascript">
function closeModal() { function closeModal() {
document.getElementById('modal').classList.add('transparent') document.getElementById('modal').classList.add('transparent')
document.body.classList.remove('scroll-lock')
} }
function showModal(login, text) { function showModal(login, text) {
document.getElementById('modal').classList.remove('transparent') document.getElementById('modal').classList.remove('transparent')
document.getElementById('modal-title').innerText = text document.getElementById('modal-title').innerText = text
document.body.classList.add('scroll-lock')
const createAccountElements = [ const createAccountElements = [
'confirm-password', 'confirm-password',
'confirm-password-label', 'confirm-password-label',