This adds an onNavigate function to the included script, enabling themes to add new functionality a bit more easily. I currently could not find a nice way to achieve running a function when navigating to another slide, other than monkey patching window.history.replaceState which is pretty ugly (events like window.onpopstate are not triggered when pushing/replacing a new state).
Granted, this is not the cleanest solution either, so definitely open for alternatives or suggestions.
This adds an
onNavigate
function to the included script, enabling themes to add new functionality a bit more easily. I currently could not find a nice way to achieve running a function when navigating to another slide, other than monkey patchingwindow.history.replaceState
which is pretty ugly (events likewindow.onpopstate
are not triggered when pushing/replacing a new state).Granted, this is not the cleanest solution either, so definitely open for alternatives or suggestions.