aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js26
1 files changed, 14 insertions, 12 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 294a648..b5ad65f 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -1045,16 +1045,14 @@ var Reveal = (function(){
var a = toArray( fragments );
- a.forEach( function( el, idx ) {
- if( !el.hasAttribute( 'data-fragment-index' ) ) {
- el.setAttribute( 'data-fragment-index', idx );
- }
- } );
-
a.sort( function( l, r ) {
return l.getAttribute( 'data-fragment-index' ) - r.getAttribute( 'data-fragment-index');
} );
+ a.forEach( function( el, idx ) {
+ el.setAttribute( 'data-fragment-index', idx );
+ } );
+
return a;
}
@@ -2309,14 +2307,12 @@ var Reveal = (function(){
toArray( fragments ).forEach( function( element, i ) {
- // Hidden fragments
- if( i > index ) {
- if( element.classList.contains( 'visible' ) ) fragmentsHidden.push( element );
- element.classList.remove( 'visible' );
- element.classList.remove( 'current-fragment' );
+ if( element.hasAttribute( 'data-fragment-index' ) ) {
+ i = parseInt( element.getAttribute( 'data-fragment-index' ), 10 );
}
+
// Visible fragments
- else {
+ if( i <= index ) {
if( !element.classList.contains( 'visible' ) ) fragmentsShown.push( element );
element.classList.add( 'visible' );
element.classList.remove( 'current-fragment' );
@@ -2325,6 +2321,12 @@ var Reveal = (function(){
element.classList.add( 'current-fragment' );
}
}
+ // Hidden fragments
+ else {
+ if( element.classList.contains( 'visible' ) ) fragmentsHidden.push( element );
+ element.classList.remove( 'visible' );
+ element.classList.remove( 'current-fragment' );
+ }
} );