doersino / markdeep-slides

Build presentation slides with Markdeep and present them right in your browser.
https://doersino.github.io/markdeep-slides/demo.md.html
BSD 2-Clause "Simplified" License
172 stars 13 forks source link

Restore scroll position more accurately when refreshing whilst in draft mode #16

Closed doersino closed 5 years ago

doersino commented 5 years ago

Right now, whichever slide is completely visible and closest to the viewport's top edge is noted in the URL hash and thus aligned to the viewport's top edge on refresh.

This keeps things simple and somewhat transparent to the user, but perhaps it would make sense to maintain a more accurate position (or offset from the top of the slide specified in the URL hash) in local storage or something?

In presentation mode, this more accurate position should of course be ignored.

doersino commented 5 years ago

Also change the URL hash to the last slide if it's higher than that (which can happen when deleting slides and then refreshing while at the very bottom of the page in draft mode).

doersino commented 5 years ago

I couldn't make this work at an acceptable level of added complexity, see the commit above this comment.