force 'ready' to fire one cycle later (#208)

This commit is contained in:
Hakim El Hattab
2012-10-24 21:42:10 -04:00
parent 747c4c4b3d
commit 4777afe0c5
2 changed files with 12 additions and 9 deletions

View 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 );
}
/**