Commit 0fa03213 authored by miripiruni's avatar miripiruni

Added slide::stopTimer, fixed pageDown to next step of inner navigation; Fix for list mode

parent 03d73e8d
......@@ -354,7 +354,7 @@ window.shower = window.shower || (function(window, document, undefined) {
* Go to slide number.
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
* @param {Function} [callback] runs only if you not in List mode.
* @returns {Number}
* @returns {Number|Boolean}
*/
shower.go = function(slideNumber, callback) {
var slide;
......@@ -363,6 +363,10 @@ window.shower = window.shower || (function(window, document, undefined) {
throw new Error('Gimme slide number as Number, baby!');
}
if ( ! shower.slideList[slideNumber]) {
return false;
}
// Also triggers popstate and invoke shower.enter__Mode()
url.hash = shower.getSlideHash(slideNumber);
......@@ -416,8 +420,13 @@ window.shower = window.shower || (function(window, document, undefined) {
var currentSlideNumber = shower.getCurrentSlideNumber(),
slide = shower.slideList[currentSlideNumber];
slide.stopTimer();
slide.next(shower);
if (shower.isSlideMode()) {
slide.stopTimer();
slide.next(shower);
} else {
shower.go(currentSlideNumber + 1);
}
if (typeof(callback) === 'function') {
callback();
......@@ -455,15 +464,9 @@ window.shower = window.shower || (function(window, document, undefined) {
*/
shower._turnPreviousSlide = function(callback) {
var currentSlideNumber = shower.getCurrentSlideNumber(),
slide;
// Slides starts from 0
if (currentSlideNumber < 1) {
return false;
}
slide = shower.slideList[currentSlideNumber];
slide = shower.slideList[currentSlideNumber];
slide.timing && slide.stopTimer();
slide.stopTimer();
if (shower.isSlideMode()) {
slide.prev(shower);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment