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;
// b, period
case 66: case 190: togglePause(); break;
// f
case 70: enterFullscreen(); break;
default:
triggered = false;
}
@ -740,6 +742,26 @@ var Reveal = (function(){
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
* black.
@ -1209,7 +1231,7 @@ var Reveal = (function(){
// another timeout
cueAutoSlide();
}
// Expose some methods publicly
return {
initialize: initialize,

131
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long