Skip to content

Commit

Permalink
Add a check in postSlide for unslick.
Browse files Browse the repository at this point in the history
because `postSlide` was running after animation,
it was posssible for the method to re-enable auto play moments before
destroying the slide, leaving any `asNavFor` targets with two timers
advancing them, and no way to clear the timer.

fixes kenwheeler#1031
  • Loading branch information
simeydotme committed Jan 23, 2016
1 parent f9f17f3 commit ae0fcfb
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions slick/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -1569,20 +1569,24 @@

var _ = this;

_.$slider.trigger('afterChange', [_, index]);
if( !_.unslicked ) {

_.$slider.trigger('afterChange', [_, index]);

_.animating = false;
_.animating = false;

_.setPosition();
_.setPosition();

_.swipeLeft = null;
_.swipeLeft = null;

if ( _.options.autoplay ) {
_.autoPlay();
}
if ( _.options.autoplay ) {
_.autoPlay();
}

if (_.options.accessibility === true) {
_.initADA();
}

if (_.options.accessibility === true) {
_.initADA();
}

};
Expand Down

0 comments on commit ae0fcfb

Please sign in to comment.