merge full screen key binding (f)

This commit is contained in:
Hakim El Hattab 2012-10-14 20:17:49 -04:00
commit e15beb47f0
2 changed files with 89 additions and 66 deletions

View File

@ -439,6 +439,8 @@ var Reveal = (function(){
case 13: isOverviewActive() ? deactivateOverview() : triggered = false; break; case 13: isOverviewActive() ? deactivateOverview() : triggered = false; break;
// b, period // b, period
case 66: case 190: togglePause(); break; case 66: case 190: togglePause(); break;
// f
case 70: enterFullscreen(); break;
default: default:
triggered = false; triggered = false;
} }
@ -740,6 +742,26 @@ var Reveal = (function(){
return dom.wrapper.classList.contains( 'overview' ); return dom.wrapper.classList.contains( 'overview' );
} }
/**
* Handling the fullscreen functionality via the fullscreen API
*
* @see http://fullscreen.spec.whatwg.org/
* @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode
*/
function enterFullscreen() {
var element = document.body;
// Check which implementation is available
var requestMethod = element.requestFullScreen ||
element.webkitRequestFullScreen ||
element.mozRequestFullScreen ||
element.msRequestFullScreen;
if( requestMethod ) {
requestMethod.apply( element );
}
}
/** /**
* Enters the paused mode which fades everything on screen to * Enters the paused mode which fades everything on screen to
* black. * black.
@ -1209,7 +1231,7 @@ var Reveal = (function(){
// another timeout // another timeout
cueAutoSlide(); cueAutoSlide();
} }
// Expose some methods publicly // Expose some methods publicly
return { return {
initialize: initialize, initialize: initialize,

131
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long