include fragments in progress bar calculation
This commit is contained in:
parent
a91f4d601d
commit
0140fd9ee6
20
js/reveal.js
20
js/reveal.js
@ -2215,6 +2215,25 @@ var Reveal = (function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( currentSlide ) {
|
||||||
|
|
||||||
|
var allFragments = currentSlide.querySelectorAll( '.fragment' );
|
||||||
|
|
||||||
|
// If there are fragments in the current slide those should be
|
||||||
|
// accounted for in the progress.
|
||||||
|
if( allFragments.length > 0 ) {
|
||||||
|
var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' );
|
||||||
|
|
||||||
|
// This value represents how big a portion of the slide progress
|
||||||
|
// that is made up by its fragments (0-1)
|
||||||
|
var fragmentWeight = 0.9;
|
||||||
|
|
||||||
|
// Add fragment progress to the past slide count
|
||||||
|
pastCount += ( visibleFragments.length / allFragments.length ) * fragmentWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return pastCount / ( totalCount - 1 );
|
return pastCount / ( totalCount - 1 );
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2519,6 +2538,7 @@ var Reveal = (function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateControls();
|
updateControls();
|
||||||
|
updateProgress();
|
||||||
|
|
||||||
return !!( fragmentsShown.length || fragmentsHidden.length );
|
return !!( fragmentsShown.length || fragmentsHidden.length );
|
||||||
|
|
||||||
|
4
js/reveal.min.js
vendored
4
js/reveal.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user