simplified getCurrentFragmentIndex impl
This commit is contained in:
1 parent
6e3487bdd6
commit
2f8aa51dc2
2 files changed
+8
-17
No files matched your search
+6
-15
@@ -2047,21 +2047,12 @@ var Reveal = (function(){
|
||||
|
||||
// Returns an index (1-based) of the current fragment
|
||||
getCurrentFragmentIndex : function() {
|
||||
var visibleFragments;
|
||||
|
||||
// vertical slides:
|
||||
if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
|
||||
visibleFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
||||
}
|
||||
// Horizontal slides:
|
||||
else {
|
||||
visibleFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
|
||||
}
|
||||
|
||||
if( visibleFragments.length) {
|
||||
return visibleFragments.length;
|
||||
} else {
|
||||
return undefined;
|
||||
if( currentSlide ) {
|
||||
var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' );
|
||||
|
||||
if( visibleFragments ) {
|
||||
return visibleFragments.length;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user