aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2015-09-10 11:10:08 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2015-09-10 11:10:08 +0200
commitbe7545da1ab3d0739ffd65e04956761b4cd36fd8 (patch)
tree40cd4d51efb2cec23c574dc1ab57b11e39a2db74 /js
parentbd6a592b8b0f5bf8e128a2da4c1c3be964d2df73 (diff)
parented8d90bc58b811a921cdad53fd6d418be8bb9765 (diff)
downloadfreenode-live-2017-presentation-be7545da1ab3d0739ffd65e04956761b4cd36fd8.tar
freenode-live-2017-presentation-be7545da1ab3d0739ffd65e04956761b4cd36fd8.tar.gz
Merge branch 'feature_prevent_swipe' of https://github.com/Calyhre/reveal.js into dev
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/reveal.js b/js/reveal.js
index ae682ac..b1a20cc 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -3954,6 +3954,8 @@
*/
function onTouchStart( event ) {
+ if(preventSwipe(event.target)) return true;
+
touch.startX = event.touches[0].clientX;
touch.startY = event.touches[0].clientY;
touch.startCount = event.touches.length;
@@ -3977,6 +3979,8 @@
*/
function onTouchMove( event ) {
+ if(preventSwipe(event.target)) return true;
+
// Each touch should only trigger one action
if( !touch.captured ) {
onUserInput( event );
@@ -4267,6 +4271,15 @@
}
+ function preventSwipe(target) {
+ while( target && typeof target.hasAttribute === 'function' ) {
+ if(target.hasAttribute('prevent-swipe')) return true;
+ target = target.parentNode;
+ }
+
+ return false;
+ }
+
// --------------------------------------------------------------------//
// ------------------------ PLAYBACK COMPONENT ------------------------//