Skip to content

Commit

Permalink
Merge pull request kenwheeler#1361 from cohenudi/master
Browse files Browse the repository at this point in the history
Prevent double-binding the click event
  • Loading branch information
simeydotme committed Feb 4, 2016
2 parents 4eb5425 + 0fa2e6b commit 12571a7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions slick/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -1313,12 +1313,16 @@
var _ = this;

if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.on('click.slick', {
message: 'previous'
}, _.changeSlide);
_.$nextArrow.on('click.slick', {
message: 'next'
}, _.changeSlide);
_.$prevArrow
.off('click.slick')
.on('click.slick', {
message: 'previous'
}, _.changeSlide);
_.$nextArrow
.off('click.slick')
.on('click.slick', {
message: 'next'
}, _.changeSlide);
}

};
Expand Down

0 comments on commit 12571a7

Please sign in to comment.