Fix navigatePrev() past beginning of stack: fixes issue #463.#463.#463.
authorRick Lupton <r.lupton@gmail.com>
Fri, 14 Jun 2013 14:03:54 +0000 (15:03 +0100)
committerRick Lupton <r.lupton@gmail.com>
Fri, 14 Jun 2013 14:12:56 +0000 (15:12 +0100)
Previously navigatePrev() was changing indexh and indexv; instead should
call slide(h, v) and let it change indexh and indexv.

js/reveal.js

index a4a71db49240dc5be52e95a39c91c4f64d318bda..51b84ea6a055262da29627dc77c48403c0501e48 100644 (file)
@@ -1758,9 +1758,9 @@ var Reveal = (function(){
                                var previousSlide = document.querySelector( HORIZONTAL_SLIDES_SELECTOR + '.past:nth-child(' + indexh + ')' );
 
                                if( previousSlide ) {
-                                       indexv = ( previousSlide.querySelectorAll( 'section' ).length + 1 ) || undefined;
-                                       indexh --;
-                                       slide( indexh, indexv );
+                                       var v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined,
+                                           h = indexh - 1;
+                                       slide( h, v );
                                }
                        }
                }