space and return keys can be used to exit the overview mode

This commit is contained in:
Hakim El Hattab 2012-05-29 18:41:50 -04:00
parent e7b8033a10
commit eaca6465fa
2 changed files with 9 additions and 5 deletions

View file

@ -189,8 +189,8 @@ var Reveal = (function(){
switch( event.keyCode ) {
// p, page up
case 80: case 33: navigatePrev(); triggered = true; break;
// n, page down, space
case 78: case 32: case 34: navigateNext(); triggered = true; break;
// n, page down
case 78: case 34: navigateNext(); triggered = true; break;
// h, left
case 72: case 37: navigateLeft(); triggered = true; break;
// l, right
@ -203,6 +203,10 @@ var Reveal = (function(){
case 36: navigateTo( 0 ); triggered = true; break;
// end
case 35: navigateTo( Number.MAX_VALUE ); triggered = true; break;
// space
case 32: overviewIsActive() ? deactivateOverview() : navigateNext(); triggered = true; break;
// return
case 13: if( overviewIsActive() ) { deactivateOverview(); triggered = true; } break;
}
if( triggered ) {

6
js/reveal.min.js vendored
View file

@ -16,9 +16,9 @@ q(G,P);if(H===false){G.transition="linear";}if(G.controls){d.controls.style.disp
}if(G.rollingLinks){D();}C();if(navigator.userAgent.match(/(iphone|ipod|android)/i)){document.documentElement.style.overflow="scroll";document.body.style.height="120%";
window.addEventListener("load",K,false);window.addEventListener("orientationchange",K,false);}}function q(Q,P){for(var R in P){Q[R]=P[R];}}function n(P){return function(Q){Q.preventDefault();
P.call();};}function K(){setTimeout(function(){window.scrollTo(0,1);},0);}function M(Q){if(Q.target.contentEditable!="inherit"||Q.shiftKey||Q.altKey||Q.ctrlKey||Q.metaKey){return;
}var P=false;switch(Q.keyCode){case 80:case 33:I();P=true;break;case 78:case 32:case 34:u();P=true;break;case 72:case 37:x();P=true;break;case 76:case 39:i();
P=true;break;case 75:case 38:r();P=true;break;case 74:case 40:A();P=true;break;case 36:E(0);P=true;break;case 35:E(Number.MAX_VALUE);P=true;break;}if(P){Q.preventDefault();
}else{if(Q.keyCode===27&&H){if(J()){L();}else{B();}Q.preventDefault();}}}function w(S){if(S.touches.length===1){if(S.target.tagName.toLowerCase()==="a"||S.target.tagName.toLowerCase()==="img"){return;
}var P=false;switch(Q.keyCode){case 80:case 33:I();P=true;break;case 78:case 34:u();P=true;break;case 72:case 37:x();P=true;break;case 76:case 39:i();P=true;
break;case 75:case 38:r();P=true;break;case 74:case 40:A();P=true;break;case 36:E(0);P=true;break;case 35:E(Number.MAX_VALUE);P=true;break;case 32:J()?L():u();
P=true;break;case 13:if(J()){L();P=true;}break;}if(P){Q.preventDefault();}else{if(Q.keyCode===27&&H){if(J()){L();}else{B();}Q.preventDefault();}}}function w(S){if(S.touches.length===1){if(S.target.tagName.toLowerCase()==="a"||S.target.tagName.toLowerCase()==="img"){return;
}S.preventDefault();var Q={x:S.touches[0].clientX,y:S.touches[0].clientY};var P=window.innerWidth*0.3;var R=window.innerHeight*0.3;if(Q.x<P){x();}else{if(Q.x>window.innerWidth-P){i();
}else{if(Q.y<R){r();}else{if(Q.y>window.innerHeight-R){A();}}}}b();}}function m(P){clearTimeout(v);v=setTimeout(function(){var Q=P.detail||-P.wheelDelta;
if(Q>0){u();}else{I();}},100);}function t(P){C();}function D(){if(H){var Q=document.querySelectorAll("#reveal .slides section a:not(.image)");for(var R=0,P=Q.length;