aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 662679b..de12ed7 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -4237,7 +4237,7 @@
}
- return pastCount / ( totalCount - 1 );
+ return Math.min( pastCount / ( totalCount - 1 ), 1 );
}
@@ -4330,11 +4330,21 @@
writeURLTimeout = setTimeout( writeURL, delay );
}
else if( currentSlide ) {
+ // If we're configured to push to history OR the history
+ // API is not avaialble.
if( config.history || !window.history ) {
window.location.hash = locationHash();
}
+ // If we're configured to refelct the current slide in the
+ // URL without pushing to history.
else if( config.hash ) {
- window.history.replaceState(null, null, '#' + locationHash());
+ window.history.replaceState( null, null, '#' + locationHash() );
+ }
+ // If history and hash are both disabled, a hash may still
+ // be added to the URL by clicking on a href with a hash
+ // target. Counter this by always removing the hash.
+ else {
+ window.history.replaceState( null, null, window.location.pathname + window.location.search );
}
}