From 43c8990f2b195e39c09f801e20beb0efa330a198 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 4 Oct 2012 09:32:20 -0400 Subject: [PATCH] prevent touchmove default action on android (#143) --- js/reveal.js | 7 ++++++- js/reveal.min.js | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 1b4d1f3b..06ecde6f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1,5 +1,5 @@ /*! - * reveal.js 2.1 r27 + * reveal.js 2.1 r28 * http://lab.hakim.se/reveal-js * MIT licensed * @@ -485,6 +485,11 @@ var Reveal = (function(){ event.preventDefault(); } + // There's a bug with swiping on some Android devices unless + // the default action is always prevented + else if( navigator.userAgent.match( /android/gi ) ) { + event.preventDefault(); + } } /** diff --git a/js/reveal.min.js b/js/reveal.min.js index 80e20e17..1a84333d 100644 --- a/js/reveal.min.js +++ b/js/reveal.min.js @@ -1,5 +1,5 @@ /*! - * reveal.js 2.1 r27 + * reveal.js 2.1 r28 * http://lab.hakim.se/reveal-js * MIT licensed * @@ -32,16 +32,16 @@ V.startCount=ac.touches.length;if(ac.touches.length===2){V.startSpan=N({x:ac.tou var ae=ah.touches[0].clientY;if(ah.touches.length===2&&V.startCount===2){var ag=N({x:ah.touches[1].clientX,y:ah.touches[1].clientY},{x:V.startX,y:V.startY}); if(Math.abs(V.startSpan-ag)>V.threshold){V.handled=true;if(agV.threshold&&Math.abs(ad)>Math.abs(ac)){V.handled=true;y();}else{if(ad<-V.threshold&&Math.abs(ad)>Math.abs(ac)){V.handled=true;h();}else{if(ac>V.threshold){V.handled=true; -r();}else{if(ac<-V.threshold){V.handled=true;C();}}}}}}ah.preventDefault();}}function R(ac){V.handled=false;}function m(ac){clearTimeout(w);w=setTimeout(function(){var ad=ac.detail||-ac.wheelDelta; -if(ad>0){u();}else{T();}},100);}function t(ac){G();}function A(ac){if(U()){ac.preventDefault();X();k=this.getAttribute("data-index-h");c=this.getAttribute("data-index-v"); -a();}}function I(){if(O&&!("msPerspective" in document.body.style)){var ad=document.querySelectorAll(".reveal .slides section a:not(.image)");for(var ae=0,ac=ad.length; -ae'+af.innerHTML+""; -}}}}function F(){if(M.overview){d.wrapper.classList.add("overview");var ac=document.querySelectorAll(j);for(var ah=0,af=ac.length;ah0){u();}else{T();}},100);}function t(ac){G();}function A(ac){if(U()){ac.preventDefault(); +X();k=this.getAttribute("data-index-h");c=this.getAttribute("data-index-v");a();}}function I(){if(O&&!("msPerspective" in document.body.style)){var ad=document.querySelectorAll(".reveal .slides section a:not(.image)"); +for(var ae=0,ac=ad.length;ae'+af.innerHTML+"";}}}}function F(){if(M.overview){d.wrapper.classList.add("overview");var ac=document.querySelectorAll(j); +for(var ah=0,af=ac.length;ah