diff options
author | Michael Kühnel <mail@michael-kuehnel.de> | 2012-10-14 10:26:40 +0200 |
---|---|---|
committer | Michael Kühnel <mail@michael-kuehnel.de> | 2012-10-14 10:26:40 +0200 |
commit | 2869f8a4ee23b061d293f927742a8daa1495246b (patch) | |
tree | a22276835bfdc112cc36250a7e5f20dd347faf73 /js/reveal.js | |
parent | c34be2e9765637ddeddbdf293de7ca98941ca6c5 (diff) | |
download | fosdem-2018-presentation-2869f8a4ee23b061d293f927742a8daa1495246b.tar fosdem-2018-presentation-2869f8a4ee23b061d293f927742a8daa1495246b.tar.gz |
Add fullscreen mode
Handling the fullscreen functionality via the fullscreen JavaScript API.
Press »f« on the keyboard to enter fullscreen mode.
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js index 3dcedf0..e95092e 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -435,6 +435,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; } @@ -1192,7 +1194,25 @@ var Reveal = (function(){ // another timeout cueAutoSlide(); } - + + /** + * 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); + } + } + // Expose some methods publicly return { initialize: initialize, |