From 785bee596b7bc444169f11bd36a4eb12af0c21eb Mon Sep 17 00:00:00 2001
From: Hakim El Hattab
Date: Sat, 10 Aug 2013 14:30:24 -0400
Subject: add embed option

---
 js/reveal.js | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

(limited to 'js/reveal.js')

diff --git a/js/reveal.js b/js/reveal.js
index 8f7eb70..12b033d 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -59,6 +59,10 @@ var Reveal = (function(){
 			// Turns fragments on and off globally
 			fragments: true,
 
+			// Flags if the presentation is running in an embedded mode,
+			// i.e. contained within a limited portion of the screen
+			embed: false,
+
 			// Number of milliseconds between automatically proceeding to the
 			// next slide, disabled when set to 0, this value can be overwritten
 			// by using a data-autoslide attribute on your slides
@@ -2371,7 +2375,18 @@ var Reveal = (function(){
 					navigateDown();
 				}
 
-				event.preventDefault();
+				// If we're embedded, only block touch events if they have
+				// triggered an action
+				if( config.embed ) {
+					if( touch.captured || isVerticalSlide( currentSlide ) ) {
+						event.preventDefault();
+					}
+				}
+				// Not embedded? Block them all to avoid needless tossing
+				// around of the viewport in iOS
+				else {
+					event.preventDefault();
+				}
 
 			}
 		}
-- 
cgit v1.2.3