From eac5a3a2399aa57b976d41050bf9690535c2be85 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sat, 10 Nov 2012 14:04:11 -0500 Subject: [PATCH] enable up/down arrows to step through fragments (closes #233) --- js/reveal.js | 10 +++++----- js/reveal.min.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 97ee048..6f527d4 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1,5 +1,5 @@ /*! - * reveal.js 2.2 r40 + * reveal.js 2.2 r41 * http://lab.hakim.se/reveal-js * MIT licensed * @@ -1134,28 +1134,28 @@ var Reveal = (function(){ function navigateLeft() { // Prioritize hiding fragments - if( availableRoutes().left && ( isOverviewActive() || previousFragment() === false ) ) { + if( availableRoutes().left && isOverviewActive() || previousFragment() === false ) { slide( indexh - 1, 0 ); } } function navigateRight() { // Prioritize revealing fragments - if( availableRoutes().right && ( isOverviewActive() || nextFragment() === false ) ) { + if( availableRoutes().right && isOverviewActive() || nextFragment() === false ) { slide( indexh + 1, 0 ); } } function navigateUp() { // Prioritize hiding fragments - if( availableRoutes().up && ( isOverviewActive() || previousFragment() === false ) ) { + if( availableRoutes().up && isOverviewActive() || previousFragment() === false ) { slide( indexh, indexv - 1 ); } } function navigateDown() { // Prioritize revealing fragments - if( availableRoutes().down && ( isOverviewActive() || nextFragment() === false ) ) { + if( availableRoutes().down && isOverviewActive() || nextFragment() === false ) { slide( indexh, indexv + 1 ); } } diff --git a/js/reveal.min.js b/js/reveal.min.js index 16599e3..d888644 100644 --- a/js/reveal.min.js +++ b/js/reveal.min.js @@ -1,5 +1,5 @@ /*! - * reveal.js 2.2 r40 + * reveal.js 2.2 r41 * http://lab.hakim.se/reveal-js * MIT licensed * @@ -74,8 +74,8 @@ t("fragmentshown",{fragment:at[0]});return true;}}else{var ar=document.querySele t("fragmentshown",{fragment:ar[0]});return true;}}return false;}function U(){if(document.querySelector(b+".present")){var at=document.querySelectorAll(b+".present .fragment.visible"); if(at.length){at[at.length-1].classList.remove("visible");t("fragmenthidden",{fragment:at[at.length-1]});return true;}}else{var ar=document.querySelectorAll(m+".present .fragment.visible"); if(ar.length){ar[ar.length-1].classList.remove("visible");t("fragmenthidden",{fragment:ar[ar.length-1]});return true;}}return false;}function R(){clearTimeout(l); -if(ac){l=setTimeout(z,ac);}}function D(){if(h().left&&(O()||U()===false)){a(n-1,0);}}function k(){if(h().right&&(O()||x()===false)){a(n+1,0);}}function w(){if(h().up&&(O()||U()===false)){a(n,e-1); -}}function H(){if(h().down&&(O()||x()===false)){a(n,e+1);}}function ad(){if(U()===false){if(h().up){w();}else{var ar=document.querySelector(".reveal .slides>section.past:nth-child("+n+")"); +if(ac){l=setTimeout(z,ac);}}function D(){if(h().left&&O()||U()===false){a(n-1,0);}}function k(){if(h().right&&O()||x()===false){a(n+1,0);}}function w(){if(h().up&&O()||U()===false){a(n,e-1); +}}function H(){if(h().down&&O()||x()===false){a(n,e+1);}}function ad(){if(U()===false){if(h().up){w();}else{var ar=document.querySelector(".reveal .slides>section.past:nth-child("+n+")"); if(ar){e=(ar.querySelectorAll("section").length+1)||0;n--;a();}}}}function z(){if(x()===false){h().down?H():k();}R();}function am(au){var at=document.activeElement; var av=!!(document.activeElement&&(document.activeElement.type||document.activeElement.href||document.activeElement.contentEditable!=="inherit"));if(av||au.shiftKey||au.altKey||au.ctrlKey||au.metaKey){return; }var ar=true;switch(au.keyCode){case 80:case 33:ad();break;case 78:case 34:z();break;case 72:case 37:D();break;case 76:case 39:k();break;case 75:case 38:w();