From: Hakim El Hattab Date: Sat, 24 Mar 2012 16:36:34 +0000 (-0400) Subject: delay hash changes to avoid transition lag in chrome and enable history by default... X-Git-Tag: 1.2.0~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=87529c4adcb047398da8416a2015d6a439f90f29;p=reveal.js.git delay hash changes to avoid transition lag in chrome and enable history by default (closes #22) --- diff --git a/index.html b/index.html index 808f0c0..1518eb9 100644 --- a/index.html +++ b/index.html @@ -225,7 +225,7 @@ progress: true, // If true; each slide will be pushed to the browser history - history: false, + history: true, // Flags if mouse wheel navigation should be enabled mouseWheel: true, diff --git a/js/reveal.js b/js/reveal.js index ba2cfd5..2ecd641 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -74,7 +74,10 @@ var Reveal = (function(){ document.body.style['OTransform'] !== undefined, // Throttles mouse wheel navigation - mouseWheelTimeout = 0; + mouseWheelTimeout = 0, + + // Delays updates to the URL due to a Chrome thumbnailer bug + writeURLTimeout = 0; /** * Starts up the slideshow by applying configuration @@ -490,7 +493,8 @@ var Reveal = (function(){ updateControls(); - writeURL(); + clearTimeout( writeURLTimeout ); + writeURLTimeout = setTimeout( writeURL, 1500 ); } /**