diff options
author | Hakim El Hattab | 2012-10-28 17:30:55 -0400 |
---|---|---|
committer | Hakim El Hattab | 2012-10-28 17:30:55 -0400 |
commit | 9da9726403ca25cfd7d6792987ce04b9299ebd2a (patch) | |
tree | e0e84039a091c6830eb0cdf574bb12b414339ee0 /js/reveal.js | |
parent | 6aafa0107dd75893db662b9f9e9178594c5e5c32 (diff) |
only call slide() if route is available in navigate methods (closes #213)
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/js/reveal.js b/js/reveal.js index 425b617..2e3ee39 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1,5 +1,5 @@ /*! - * reveal.js 2.1 r36 + * reveal.js 2.1 r37 * http://lab.hakim.se/reveal-js * MIT licensed * @@ -1014,28 +1014,28 @@ var Reveal = (function(){ function navigateLeft() { // Prioritize hiding fragments - if( isOverviewActive() || previousFragment() === false ) { + if( availableRoutes().left && ( isOverviewActive() || previousFragment() === false ) ) { slide( indexh - 1, 0 ); } } function navigateRight() { // Prioritize revealing fragments - if( isOverviewActive() || nextFragment() === false ) { + if( availableRoutes().right && ( isOverviewActive() || nextFragment() === false ) ) { slide( indexh + 1, 0 ); } } function navigateUp() { // Prioritize hiding fragments - if( isOverviewActive() || previousFragment() === false ) { + if( availableRoutes().up && ( isOverviewActive() || previousFragment() === false ) ) { slide( indexh, indexv - 1 ); } } function navigateDown() { // Prioritize revealing fragments - if( isOverviewActive() || nextFragment() === false ) { + if( availableRoutes().down && ( isOverviewActive() || nextFragment() === false ) ) { slide( indexh, indexv + 1 ); } } @@ -1057,7 +1057,7 @@ var Reveal = (function(){ var previousSlide = document.querySelector( '.reveal .slides>section.past:nth-child(' + indexh + ')' ); if( previousSlide ) { - indexv = ( previousSlide.querySelectorAll('section').length + 1 ) || 0; + indexv = ( previousSlide.querySelectorAll( 'section' ).length + 1 ) || 0; indexh --; slide(); } |