Skip to content

Commit

Permalink
Make body inert by default
Browse files Browse the repository at this point in the history
It is up to the JavaScript code to revert it into a non-inert state.
In this way, the page elements that require JS (header modals, the form,
etc.) will not be accessible until a script removes the attribute from
the `body`.
  • Loading branch information
dabico committed Jul 1, 2024
1 parent 4f0c87d commit 269979e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h1 class="modal-title fs-5" id="noscript-modal-label">JavaScript is Disabled</h
</div>
</noscript>
</head>
<body class="min-vh-100 mw-100 d-flex flex-column justify-content-between">
<body inert class="min-vh-100 mw-100 d-flex flex-column justify-content-between">
<header class="mb-3">
<nav aria-label="navbar" class="navbar navbar-expand-sm bg-light">
<div class="container-fluid">
Expand Down
2 changes: 1 addition & 1 deletion html/js/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
storage.setItem(key, today.toISOString());
}

$("body").tooltip({
$("body").removeAttr("inert").tooltip({
selector: "[data-bs-toggle='tooltip']"
});
});
Expand Down

0 comments on commit 269979e

Please sign in to comment.