content & style opti, new tool annotation
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s
This commit is contained in:
parent
0db35a0d2c
commit
6e1472d2fb
21 changed files with 1112 additions and 194 deletions
15
website/src/utils/bodyScrollLock.js
Normal file
15
website/src/utils/bodyScrollLock.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
export function lockBodyScroll() {
|
||||
const currentLocks = Number(document.body.dataset.modalLocks || 0);
|
||||
document.body.dataset.modalLocks = String(currentLocks + 1);
|
||||
document.body.classList.add("is-modal-open");
|
||||
|
||||
return () => {
|
||||
const nextLocks = Math.max(0, Number(document.body.dataset.modalLocks || 0) - 1);
|
||||
if (nextLocks) {
|
||||
document.body.dataset.modalLocks = String(nextLocks);
|
||||
return;
|
||||
}
|
||||
delete document.body.dataset.modalLocks;
|
||||
document.body.classList.remove("is-modal-open");
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue