simplified getCurrentFragmentIndex impl
parent
6e3487bdd6
commit
2f8aa51dc2
21
js/reveal.js
21
js/reveal.js
|
@ -2047,21 +2047,12 @@ var Reveal = (function(){
|
||||||
|
|
||||||
// Returns an index (1-based) of the current fragment
|
// Returns an index (1-based) of the current fragment
|
||||||
getCurrentFragmentIndex : function() {
|
getCurrentFragmentIndex : function() {
|
||||||
var visibleFragments;
|
if( currentSlide ) {
|
||||||
|
var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' );
|
||||||
// vertical slides:
|
|
||||||
if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
|
if( visibleFragments ) {
|
||||||
visibleFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
return visibleFragments.length;
|
||||||
}
|
}
|
||||||
// Horizontal slides:
|
|
||||||
else {
|
|
||||||
visibleFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( visibleFragments.length) {
|
|
||||||
return visibleFragments.length;
|
|
||||||
} else {
|
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue