Permalink
Browse files

bug fix: removed setInterval, replaced by resetInterval

  • Loading branch information...
1 parent efdd103 commit c21eaffde6ce233793603234e4fbe90553df509b charlyisidore committed Aug 2, 2011
Showing with 6 additions and 8 deletions.
  1. +6 −8 slideshow.js
View
@@ -99,7 +99,7 @@ var Slideshow = new Class(
*/
play: function()
{
- this.setInterval();
+ this.resetInterval();
this.fireEvent( 'play' );
return this;
},
@@ -217,12 +217,6 @@ var Slideshow = new Class(
return this;
},
- setInterval: function()
- {
- this.interval = this.show.periodical( this.options.period, this, [ 'next', { _callback: true } ] );
- return this;
- },
-
clearInterval: function()
{
clearInterval( this.interval );
@@ -232,7 +226,11 @@ var Slideshow = new Class(
resetInterval: function()
{
- this.clearInterval().setInterval();
+ if ( this.interval )
+ {
+ this.clearInterval();
+ }
+ this.interval = this.show.periodical( this.options.period, this, [ 'next', { _callback: true } ] );
return this;
},

0 comments on commit c21eaff

Please sign in to comment.