ToC links to 'static' slides
yanhasu opened this issue · 3 comments
Hello! I just tried navigating the tutorial in https://ucsd-progsys.github.io/intro-refinement-types/120/ and the the table of contents only seems to work if clicking on the links leading to section titles. For instance, when going to https://ucsd-progsys.github.io/intro-refinement-types/120/01-index.html#/whats-this, neither Chrome 19.0 nor Firefox 76.0 can move through the slides.
Originally posted by @facundominguez in ucsd-progsys/liquidhaskell#1859 (comment)
A bit of poking around finds that numeric hashes do work, i.e.
https://ucsd-progsys.github.io/intro-refinement-types/120/01-index.html#4
gives the moth page as before, but this time with the navigation working.
It appears that these links are generated by:
intro-refinement-types/assets/filters/Toc.hs
Line 135 in 099e7ef
so patching that should make the issue go away.
This links works indeed https://ucsd-progsys.github.io/intro-refinement-types/120/01-index.html#4
but only the first time the page is loaded. If one refresh the page, or returns to the page with the "back" and "forward" buttons of the browser, then the slide navigation breaks again. I see this javascript error in the console.
onepagescroll.js:86 Uncaught TypeError: Cannot read property 'dataset' of null
at init (onepagescroll.js:86)
at onePageScroll (onepagescroll.js:489)
at 01-index.html:608
I think the break-on-reload problem is due to the automatic redirection from https://ucsd-progsys.github.io/intro-refinement-types/120/01-index.html#4 to https://ucsd-progsys.github.io/intro-refinement-types/120/01-index.html#/4 (notice the extra slash at the end).
It also happens if you use the normal navigation buttons at the bottom right of the presentation, although the (Firefox 90.1) back/forward buttons didn't break it for me.
The error is raised in the part of the onepagescroll.js
script which parses the string after the hash. The string isn't in the right format, so a null gets returned and the website bugs out.
Unless the redirection is something we explicitly added on (@ranjitjhala?), then I don't think there's much we can do about the break-on-reload problem other than update reveal.js
and/or tell its developers.