@@ -1047,7 +1047,7 @@ var Reveal = (function(){
1047
1047
1048
1048
a . forEach ( function ( el , idx ) {
1049
1049
if ( ! el . hasAttribute ( 'data-fragment-index' ) ) {
1050
- el . setAttribute ( 'data-fragment-index' , idx + 1 ) ;
1050
+ el . setAttribute ( 'data-fragment-index' , idx ) ;
1051
1051
}
1052
1052
} ) ;
1053
1053
@@ -2261,7 +2261,7 @@ var Reveal = (function(){
2261
2261
var hasFragments = currentSlide . querySelectorAll ( '.fragment' ) . length > 0 ;
2262
2262
if ( hasFragments ) {
2263
2263
var visibleFragments = currentSlide . querySelectorAll ( '.fragment.visible' ) ;
2264
- f = visibleFragments . length ;
2264
+ f = visibleFragments . length - 1 ;
2265
2265
}
2266
2266
}
2267
2267
@@ -2273,7 +2273,7 @@ var Reveal = (function(){
2273
2273
* Navigate to the specified slide fragment.
2274
2274
*
2275
2275
* @param {Number } index The index of the fragment that
2276
- * should be shown, 1-based, 0 means all are invisible
2276
+ * should be shown, -1 means all are invisible
2277
2277
* @param {Number } offset Integer offset to apply to the
2278
2278
* fragment index
2279
2279
*
@@ -2292,10 +2292,10 @@ var Reveal = (function(){
2292
2292
var lastVisibleFragment = sortFragments ( currentSlide . querySelectorAll ( '.fragment.visible' ) ) . pop ( ) ;
2293
2293
2294
2294
if ( lastVisibleFragment ) {
2295
- index = parseInt ( lastVisibleFragment . getAttribute ( 'data-fragment-index' ) || 1 , 10 ) ;
2295
+ index = parseInt ( lastVisibleFragment . getAttribute ( 'data-fragment-index' ) || 0 , 10 ) ;
2296
2296
}
2297
2297
else {
2298
- index = 0 ;
2298
+ index = - 1 ;
2299
2299
}
2300
2300
}
2301
2301
@@ -2309,8 +2309,14 @@ var Reveal = (function(){
2309
2309
2310
2310
toArray ( fragments ) . forEach ( function ( element , i ) {
2311
2311
2312
+ // Hidden fragments
2313
+ if ( i > index ) {
2314
+ if ( element . classList . contains ( 'visible' ) ) fragmentsHidden . push ( element ) ;
2315
+ element . classList . remove ( 'visible' ) ;
2316
+ element . classList . remove ( 'current-fragment' ) ;
2317
+ }
2312
2318
// Visible fragments
2313
- if ( i < index ) {
2319
+ else {
2314
2320
if ( ! element . classList . contains ( 'visible' ) ) fragmentsShown . push ( element ) ;
2315
2321
element . classList . add ( 'visible' ) ;
2316
2322
element . classList . remove ( 'current-fragment' ) ;
@@ -2319,12 +2325,6 @@ var Reveal = (function(){
2319
2325
element . classList . add ( 'current-fragment' ) ;
2320
2326
}
2321
2327
}
2322
- // Hidden fragments
2323
- else {
2324
- if ( element . classList . contains ( 'visible' ) ) fragmentsHidden . push ( element ) ;
2325
- element . classList . remove ( 'visible' ) ;
2326
- element . classList . remove ( 'current-fragment' ) ;
2327
- }
2328
2328
2329
2329
2330
2330
} ) ;
0 commit comments