Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md (setup and step-by-step recipes) and a README in each main folder, with an index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to JSDoc @file blocks, define a three-level header template in website/AGENTS.md and check the header in tests/file-headers.test.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
600 B
JavaScript
19 lines
600 B
JavaScript
/**
|
|
* @file Bloque le scroll de page derrière les modales actives.
|
|
*/
|
|
|
|
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");
|
|
};
|
|
}
|