aboutsummaryrefslogtreecommitdiff
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-02-16 17:37:59 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-02-16 17:37:59 +0100
commit26e9ce1ff7d96601a83e2baa02e46699929ceada (patch)
treeaaf0b7003a04190cab0911633130efc90a50ccb7 /js/reveal.js
parent2aef97584a2c459d425d3ade55633120972c1ca7 (diff)
downloadperl-software-in-gnu-guix-26e9ce1ff7d96601a83e2baa02e46699929ceada.tar
perl-software-in-gnu-guix-26e9ce1ff7d96601a83e2baa02e46699929ceada.tar.gz
avoid creating duplicate auto-slide controls #770
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 66c975e..50cd721 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -591,7 +591,13 @@ var Reveal = (function(){
enablePreviewLinks( '[data-preview-link]' );
}
- // Auto-slide playback controls
+ // Remove existing auto-slide controls
+ if( autoSlidePlayer ) {
+ autoSlidePlayer.destroy();
+ autoSlidePlayer = null;
+ }
+
+ // Generate auto-slide controls if needed
if( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) {
autoSlidePlayer = new Playback( dom.wrapper, function() {
return Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 );
@@ -600,10 +606,6 @@ var Reveal = (function(){
autoSlidePlayer.on( 'click', onAutoSlidePlayerClick );
autoSlidePaused = false;
}
- else if( autoSlidePlayer ) {
- autoSlidePlayer.destroy();
- autoSlidePlayer = null;
- }
// Load the theme in the config, if it's not already loaded
if( config.theme && dom.theme ) {