docbook / xslTNG

DocBook xslTNG Stylesheets
https://xsltng.docbook.org
MIT License
41 stars 20 forks source link

Persistent TOC icon not visible in chunked output #498

Open mrotteveel opened 2 months ago

mrotteveel commented 2 months ago

The persistent TOC icon is not visible in the chunked output. The reason is this commit: d26e26b32d2061f53c8669f4ebd580b023d5fdbd, which bumped the z-index of nav.top to 100. Unfortunately, the styling of the nav.tocopen is done by persistent-toc.js, which sets the z-index to 3, which is lower than 100, so the icon isn't displayed.

This can be observed, for example on https://xsltng.docbook.org/guide/2.2.0/parti, the persistent toc icon is missing from the top-right corner, while on https://xsltng.docbook.org/guide/2.1.9/parti it's present.

mrotteveel commented 2 months ago

It looks like the problem is fixed by changing persistent-toc.js from

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

  toc.style.zIndex = 4;

to

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

  toc.style.zIndex = 102;

The change to tocOpen.style ensures the icon is shown, the change to toc.style is necessary because otherwise the persistent TOC can not be closed as the "Table of Contents" title and the close button are under the nav.