|
@ -147,7 +147,7 @@ var Reveal = (function(){ |
|
|
startY: 0, |
|
|
startY: 0, |
|
|
startSpan: 0, |
|
|
startSpan: 0, |
|
|
startCount: 0, |
|
|
startCount: 0, |
|
|
handled: false, |
|
|
captured: false, |
|
|
threshold: 40 |
|
|
threshold: 40 |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -2315,11 +2315,11 @@ var Reveal = (function(){ |
|
|
function onTouchMove( event ) { |
|
|
function onTouchMove( event ) { |
|
|
|
|
|
|
|
|
// Each touch should only trigger one action
|
|
|
// Each touch should only trigger one action
|
|
|
if( !touch.handled ) { |
|
|
if( !touch.captured ) { |
|
|
var currentX = event.touches[0].clientX; |
|
|
var currentX = event.touches[0].clientX; |
|
|
var currentY = event.touches[0].clientY; |
|
|
var currentY = event.touches[0].clientY; |
|
|
|
|
|
|
|
|
// If the touch started off with two points and still has
|
|
|
// If the touch started with two points and still has
|
|
|
// two active touches; test for the pinch gesture
|
|
|
// two active touches; test for the pinch gesture
|
|
|
if( event.touches.length === 2 && touch.startCount === 2 && config.overview ) { |
|
|
if( event.touches.length === 2 && touch.startCount === 2 && config.overview ) { |
|
|
|
|
|
|
|
@ -2335,7 +2335,7 @@ var Reveal = (function(){ |
|
|
// If the span is larger than the desire amount we've got
|
|
|
// If the span is larger than the desire amount we've got
|
|
|
// ourselves a pinch
|
|
|
// ourselves a pinch
|
|
|
if( Math.abs( touch.startSpan - currentSpan ) > touch.threshold ) { |
|
|
if( Math.abs( touch.startSpan - currentSpan ) > touch.threshold ) { |
|
|
touch.handled = true; |
|
|
touch.captured = true; |
|
|
|
|
|
|
|
|
if( currentSpan < touch.startSpan ) { |
|
|
if( currentSpan < touch.startSpan ) { |
|
|
activateOverview(); |
|
|
activateOverview(); |
|
@ -2355,19 +2355,19 @@ var Reveal = (function(){ |
|
|
deltaY = currentY - touch.startY; |
|
|
deltaY = currentY - touch.startY; |
|
|
|
|
|
|
|
|
if( deltaX > touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { |
|
|
if( deltaX > touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { |
|
|
touch.handled = true; |
|
|
touch.captured = true; |
|
|
navigateLeft(); |
|
|
navigateLeft(); |
|
|
} |
|
|
} |
|
|
else if( deltaX < -touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { |
|
|
else if( deltaX < -touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { |
|
|
touch.handled = true; |
|
|
touch.captured = true; |
|
|
navigateRight(); |
|
|
navigateRight(); |
|
|
} |
|
|
} |
|
|
else if( deltaY > touch.threshold ) { |
|
|
else if( deltaY > touch.threshold ) { |
|
|
touch.handled = true; |
|
|
touch.captured = true; |
|
|
navigateUp(); |
|
|
navigateUp(); |
|
|
} |
|
|
} |
|
|
else if( deltaY < -touch.threshold ) { |
|
|
else if( deltaY < -touch.threshold ) { |
|
|
touch.handled = true; |
|
|
touch.captured = true; |
|
|
navigateDown(); |
|
|
navigateDown(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -2388,7 +2388,7 @@ var Reveal = (function(){ |
|
|
*/ |
|
|
*/ |
|
|
function onTouchEnd( event ) { |
|
|
function onTouchEnd( event ) { |
|
|
|
|
|
|
|
|
touch.handled = false; |
|
|
touch.captured = false; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|