merge prev/next navigation pull request with modifications
This commit is contained in:
parent
732ed921eb
commit
0cd3b8d430
@ -66,6 +66,7 @@ Reveal.initialize({
|
|||||||
- Support for mouse wheel navigation ([naugtur](https://github.com/naugtur))
|
- Support for mouse wheel navigation ([naugtur](https://github.com/naugtur))
|
||||||
- Delayed updates to URL hash to work around a bug in Chrome
|
- Delayed updates to URL hash to work around a bug in Chrome
|
||||||
- Included a classList polyfill for IE9
|
- Included a classList polyfill for IE9
|
||||||
|
- Support for wireless presenter keys
|
||||||
|
|
||||||
#### 1.1
|
#### 1.1
|
||||||
|
|
||||||
|
31
js/reveal.js
31
js/reveal.js
@ -659,22 +659,41 @@ var Reveal = (function(){
|
|||||||
slide();
|
slide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigates backwards, prioritized in the following order:
|
||||||
|
* 1) Previous fragment
|
||||||
|
* 2) Previous vertical slide
|
||||||
|
* 3) Previous horizontal slide
|
||||||
|
*/
|
||||||
function navigatePrev() {
|
function navigatePrev() {
|
||||||
if( availableRoutes().up ) navigateUp();
|
// Prioritize revealing fragments
|
||||||
|
if( previousFragment() === false ) {
|
||||||
|
if( availableRoutes().up ) {
|
||||||
|
navigateUp();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// Go to last slide in previous vertical stack
|
// Fetch the previous horizontal slide, if there is one
|
||||||
var pastSlides = document.querySelectorAll('#reveal .slides>section.past');
|
var previousSlide = document.querySelector( '#reveal .slides>section.past:nth-child(' + indexh + ')' );
|
||||||
if( pastSlides.length > 0 ) {
|
|
||||||
var prevVerticalSlides = pastSlides[pastSlides.length - 1].querySelectorAll('section');
|
if( previousSlide ) {
|
||||||
indexv = prevVerticalSlides.length > 0 ? prevVerticalSlides.length - 1 : 0;
|
indexv = ( previousSlide.querySelectorAll('section').length + 1 ) || 0;
|
||||||
indexh --;
|
indexh --;
|
||||||
slide();
|
slide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Same as #navigatePrev() but navigates forwards.
|
||||||
|
*/
|
||||||
function navigateNext() {
|
function navigateNext() {
|
||||||
|
// Prioritize revealing fragments
|
||||||
|
if( nextFragment() === false ) {
|
||||||
availableRoutes().down ? navigateDown() : navigateRight();
|
availableRoutes().down ? navigateDown() : navigateRight();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Expose some methods publicly
|
// Expose some methods publicly
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user