Merge branch '2380-linear-navigation-mobile' of https://github.com/earboxer/reveal.js into dev
This commit is contained in:
commit
51e8da5d9a
43
js/reveal.js
43
js/reveal.js
@ -3951,6 +3951,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
if( config.navigationMode === 'linear' ) {
|
||||
routes.right = routes.right || routes.down;
|
||||
routes.left = routes.left || routes.up;
|
||||
}
|
||||
|
||||
// Reverse horizontal controls for rtl
|
||||
if( config.rtl ) {
|
||||
var left = routes.left;
|
||||
@ -5436,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
|
||||
|
Loading…
Reference in New Issue
Block a user