Skip to content

Commit

Permalink
* Mobile Linear Navigation: Fix swipes to navigate linearly
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach DeCook committed May 29, 2019
1 parent c62f4c7 commit 5384615
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5441,19 +5441,49 @@

if( deltaX > touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) {
touch.captured = true;
navigateLeft();
if (config.navigationMode === "linear") {
if( config.rtl ) {
navigateNext();
}
else {
navigatePrev();
}
}
else {
navigateLeft();
}
}
else if( deltaX < -touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) {
touch.captured = true;
navigateRight();
if (config.navigationMode === "linear") {
if( config.rtl ) {
navigatePrev();
}
else {
navigateNext();
}
}
else {
navigateRight();
}
}
else if( deltaY > touch.threshold ) {
touch.captured = true;
navigateUp();
if (config.navigationMode === "linear") {
navigatePrev();
}
else {
navigateUp();
}
}
else if( deltaY < -touch.threshold ) {
touch.captured = true;
navigateDown();
if (config.navigationMode === "linear") {
navigateNext();
}
else {
navigateDown();
}
}

// If we're embedded, only block touch events if they have
Expand Down

0 comments on commit 5384615

Please sign in to comment.