From: Chris Lawrence Date: Sat, 8 Jun 2013 09:45:48 +0000 (-0400) Subject: Only call embedded content bits if the slide actually changed. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d3ebbf1be72dc1ea17c7c6e48f8c362feb4deb94;p=reveal.js.git Only call embedded content bits if the slide actually changed. --- diff --git a/js/reveal.js b/js/reveal.js index a4a71db..8e5fd98 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1128,7 +1128,8 @@ var Reveal = (function(){ } // Dispatch an event if the slide changed - if( indexh !== indexhBefore || indexv !== indexvBefore ) { + var slideChanged = (indexh !== indexhBefore || indexv !== indexvBefore); + if( slideChanged ) { dispatchEvent( 'slidechanged', { 'indexh': indexh, 'indexv': indexv, @@ -1165,8 +1166,10 @@ var Reveal = (function(){ } // Handle embedded content - stopEmbeddedContent( previousSlide ); - startEmbeddedContent( currentSlide ); + if (slideChanged) { + stopEmbeddedContent( previousSlide ); + startEmbeddedContent( currentSlide ); + } updateControls(); updateProgress();