Skip to content

Commit

Permalink
Merge pull request #525 from ndw/iss-498
Browse files Browse the repository at this point in the history
Make sure the persistent ToC is visible in chunked output
  • Loading branch information
ndw authored Oct 11, 2024
2 parents 84a9bfd + cb4e9af commit f628c4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/scss/media-screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ nav.top {
width: 100%;
background-color: var(--nav-background-color);
opacity: 1;
z-index: 100; /* make sure floating elements go under it! */
/* N.B. this "makes sure" that floating elments go under it,
but it also interacts with the persistent ToC which must
go over it. If you're thinking of changing this, think
of changing js/persistent-toc.js as well. */
z-index: 100;
}

body.home nav.top {
Expand Down
8 changes: 6 additions & 2 deletions src/main/web/js/persistent-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@
toc.innerHTML = tocScript.innerHTML;

tocOpen.style.display = "inline";
tocOpen.style.zIndex = 3;

toc.style.zIndex = 4;
/* N.B. these z-index changes "make sure" that the persistent ToC is visible
in the nav bar, but they also interact with the z-index of the nav bar. If
you're thinking of changing these, think of changing scss/media-screen.scss
as well. */
tocOpen.style.zIndex = 101;
toc.style.zIndex = 102;

if (window.location.search === "?toc") {
showToC(null);
Expand Down

0 comments on commit f628c4c

Please sign in to comment.