use first fragment's data-autoslide value when there is no current fragment

edit
Hakim El Hattab 2016-06-27 11:13:09 +02:00
parent 65a90cc75d
commit 1da1ff0d6d
1 changed files with 6 additions and 2 deletions

View File

@ -3682,9 +3682,13 @@
if( currentSlide ) { if( currentSlide ) {
var currentFragment = currentSlide.querySelector( '.current-fragment' ); var fragment = currentSlide.querySelector( '.current-fragment' );
var fragmentAutoSlide = currentFragment ? currentFragment.getAttribute( 'data-autoslide' ) : null; // When the slide first appears there is no "current" fragment so
// we look for a data-autoslide timing on the first fragment
if( !fragment ) fragment = currentSlide.querySelector( '.fragment' );
var fragmentAutoSlide = fragment ? fragment.getAttribute( 'data-autoslide' ) : null;
var parentAutoSlide = currentSlide.parentNode ? currentSlide.parentNode.getAttribute( 'data-autoslide' ) : null; var parentAutoSlide = currentSlide.parentNode ? currentSlide.parentNode.getAttribute( 'data-autoslide' ) : null;
var slideAutoSlide = currentSlide.getAttribute( 'data-autoslide' ); var slideAutoSlide = currentSlide.getAttribute( 'data-autoslide' );