Minor updates
authorRory Hardy <rory.cronin-hardy@cerner.com>
Mon, 5 Aug 2013 01:27:47 +0000 (20:27 -0500)
committerRory Hardy <rory.cronin-hardy@cerner.com>
Mon, 5 Aug 2013 01:27:47 +0000 (20:27 -0500)
Changed invert to naturalSwipe
Removed invert rule from index.html
Ensured that left/right swipes only work with 1 hand present
modified:   index.html
modified:   plugin/leap/leap.js

index.html
plugin/leap/leap.js

index decc2944389cc199617daf412cd3fda122210b18..9ee094115bce07203edd8e25f42bb9033c7d0bca 100644 (file)
@@ -359,9 +359,6 @@ function linkify( selector ) {
                                progress: true,
                                history: true,
                                center: true,
-                               leap: {
-                           invert : true
-                         },
 
                                theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
                                transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
index 27dc517a2a7c8d53010b0af5c6c3c566ac9200f5..ad2e3db7458672253f5f8f79d22363307d9535eb 100644 (file)
@@ -25,7 +25,7 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
       lastGesture = 0,
       config      = Reveal.getConfig().leap ||
         {
-          invert: false
+          naturalSwipe: true
         },
       now;
 
@@ -43,20 +43,20 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
 
       
       if ( gesture.speed > 1000 && gesture.state === 'start' && gesture.type === 'swipe' ) {
-        if( frame.fingers.length > 1 ) {
+        if( frame.hands.length === 1 && frame.fingers.length > 1 ) {
           if ( Math.abs(x) > Math.abs(y) ) {
             if ( x > 0 ) {
-              config.invert ? Reveal.left() : Reveal.right();
+              config.naturalSwipe ? Reveal.left() : Reveal.right();
             } else {
-              config.invert ? Reveal.right() : Reveal.left();
+              config.naturalSwipe ? Reveal.right() : Reveal.left();
             }
 
             lastGesture = now;
           } else {
             if ( y > 0 ) {
-              config.invert ? Reveal.down() : Reveal.up();
+              config.naturalSwipe ? Reveal.down() : Reveal.up();
             } else {
-              config.invert ? Reveal.up() : Reveal.down();
+              config.naturalSwipe ? Reveal.up() : Reveal.down();
             }
           }