force 'ready' to fire one cycle later (#208)
authorHakim El Hattab <hakim.elhattab@gmail.com>
Thu, 25 Oct 2012 01:42:10 +0000 (21:42 -0400)
committerHakim El Hattab <hakim.elhattab@gmail.com>
Thu, 25 Oct 2012 01:42:10 +0000 (21:42 -0400)
js/reveal.js
js/reveal.min.js

index fcc064d403ceea34b20cbc3a1c96528010ca621a..119465701b38fa7710cb9260d636f0a6d2a98573 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * reveal.js 2.1 r35
+ * reveal.js 2.1 r36
  * http://lab.hakim.se/reveal-js
  * MIT licensed
  *
@@ -268,12 +268,15 @@ var Reveal = (function(){
                // Start auto-sliding if it's enabled
                cueAutoSlide();
 
-               // Notify listeners that the presentation is ready
-               dispatchEvent( 'ready', {
-                       'indexh': indexh, 
-                       'indexv': indexv,
-                       'currentSlide': currentSlide
-               } );
+               // Notify listeners that the presentation is ready but use a 1ms
+               // timeout to ensure it's not fired synchronously after #initialize()
+               setTimeout( function() {
+                       dispatchEvent( 'ready', {
+                               'indexh': indexh,
+                               'indexv': indexv,
+                               'currentSlide': currentSlide
+                       } );
+               }, 1 );
        }
 
        /**
index 958d271d6b6d5708c21ed1414df4522d135a99ce..f82e040208deba34c389653de3d1a41cd42704e2 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * reveal.js 2.1 r35
+ * reveal.js 2.1 r36
  * http://lab.hakim.se/reveal-js
  * MIT licensed
  *
@@ -17,7 +17,7 @@ f.controlsDown=document.querySelector(".reveal .controls .down");}}function d(){
 document.body.style.height="120%";window.addEventListener("load",ad,false);window.addEventListener("orientationchange",ad,false);}}function V(){var am=[],aq=[];
 for(var an=0,al=R.dependencies.length;an<al;an++){var ao=R.dependencies[an];if(!ao.condition||ao.condition()){if(ao.async){aq.push(ao.src);}else{am.push(ao.src);
 }if(typeof ao.callback==="function"){head.ready(ao.src.match(/([\w\d_\-]*)\.?[^\\\/]*$/i)[0],ao.callback);}}}function ap(){head.js.apply(null,aq);H();}if(am.length){head.ready(ap);
-head.js.apply(null,am);}else{ap();}}function H(){P();E();K();J();O();r("ready",{indexh:m,indexv:e,currentSlide:G});}function K(){if(T===false){R.transition="linear";
+head.js.apply(null,am);}else{ap();}}function H(){P();E();K();J();O();setTimeout(function(){r("ready",{indexh:m,indexv:e,currentSlide:G});},1);}function K(){if(T===false){R.transition="linear";
 }if(R.controls&&f.controls){f.controls.style.display="block";}if(R.progress&&f.progress){f.progress.style.display="block";}if(R.transition!=="default"){f.wrapper.classList.add(R.transition);
 }if(R.mouseWheel){document.addEventListener("DOMMouseScroll",o,false);document.addEventListener("mousewheel",o,false);}if(R.rollingLinks){N();}if(R.theme&&f.theme){var an=f.theme.getAttribute("href");
 var al=/[^\/]*?(?=\.css)/;var am=an.match(al)[0];if(R.theme!==am){an=an.replace(al,R.theme);f.theme.setAttribute("href",an);}}}function E(){document.addEventListener("touchstart",A,false);