aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab2012-10-14 20:17:49 -0400
committerHakim El Hattab2012-10-14 20:17:49 -0400
commite15beb47f0ca0e3db22d70b0b6a5d21d02f514ab (patch)
treef27f06d96ff2cb29d208bc213f9b9d893093c0b0 /js/reveal.js
parent68139e64e958b9edaf38a57839a7de74a80d277d (diff)
parentec58a913f2618b648b857b3e835d6ab65bf613ed (diff)
merge full screen key binding (f)
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 43e29f4..3372029 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -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;
}
@@ -741,6 +743,26 @@ var Reveal = (function(){
}
/**
+ * 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,