Added slide::stopTimer, fixed pageDown to next step of inner navigation; Fix for list mode
This commit is contained in:
parent
03d73e8d79
commit
0fa03213c5
25
shower.js
25
shower.js
|
@ -354,7 +354,7 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
* Go to slide number.
|
* Go to slide number.
|
||||||
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
|
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
|
||||||
* @param {Function} [callback] runs only if you not in List mode.
|
* @param {Function} [callback] runs only if you not in List mode.
|
||||||
* @returns {Number}
|
* @returns {Number|Boolean}
|
||||||
*/
|
*/
|
||||||
shower.go = function(slideNumber, callback) {
|
shower.go = function(slideNumber, callback) {
|
||||||
var slide;
|
var slide;
|
||||||
|
@ -363,6 +363,10 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
throw new Error('Gimme slide number as Number, baby!');
|
throw new Error('Gimme slide number as Number, baby!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! shower.slideList[slideNumber]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Also triggers popstate and invoke shower.enter__Mode()
|
// Also triggers popstate and invoke shower.enter__Mode()
|
||||||
url.hash = shower.getSlideHash(slideNumber);
|
url.hash = shower.getSlideHash(slideNumber);
|
||||||
|
|
||||||
|
@ -416,8 +420,13 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
var currentSlideNumber = shower.getCurrentSlideNumber(),
|
var currentSlideNumber = shower.getCurrentSlideNumber(),
|
||||||
slide = shower.slideList[currentSlideNumber];
|
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') {
|
if (typeof(callback) === 'function') {
|
||||||
callback();
|
callback();
|
||||||
|
@ -455,15 +464,9 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
*/
|
*/
|
||||||
shower._turnPreviousSlide = function(callback) {
|
shower._turnPreviousSlide = function(callback) {
|
||||||
var currentSlideNumber = shower.getCurrentSlideNumber(),
|
var currentSlideNumber = shower.getCurrentSlideNumber(),
|
||||||
slide;
|
slide = shower.slideList[currentSlideNumber];
|
||||||
|
|
||||||
// Slides starts from 0
|
slide.stopTimer();
|
||||||
if (currentSlideNumber < 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
slide = shower.slideList[currentSlideNumber];
|
|
||||||
slide.timing && slide.stopTimer();
|
|
||||||
|
|
||||||
if (shower.isSlideMode()) {
|
if (shower.isSlideMode()) {
|
||||||
slide.prev(shower);
|
slide.prev(shower);
|
||||||
|
|
Loading…
Reference in New Issue