Skip to content

Commit

Permalink
adds patch for appenddots issue kenwheeler#2663
Browse files Browse the repository at this point in the history
  • Loading branch information
mhaze committed Dec 4, 2020
1 parent 7daf56c commit acb7fc6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
29 changes: 19 additions & 10 deletions slick/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,10 +1360,15 @@
_.$dots.attr('role', 'tablist').find('li').each(function(i) {
var mappedSlideIndex = tabControlIndexes[i];

if (mappedSlideIndex === undefined) {
var j = i - _.$dots.length;
mappedSlideIndex = tabControlIndexes[j];
}

$(this).attr({
'role': 'presentation'
});

$(this).find('button').first().attr({
'role': 'tab',
'id': 'slick-slide-control' + _.instanceUid + i,
Expand All @@ -1372,7 +1377,7 @@
'aria-selected': null,
'tabindex': '-1'
});

}).eq(_.currentSlide).find('button').attr({
'aria-selected': 'true',
'tabindex': '0'
Expand Down Expand Up @@ -2983,15 +2988,19 @@

if (_.$dots !== null) {

_.$dots
.find('li')
.removeClass('slick-active')
.end();
_.$dots.each(function (i) {

_.$dots.eq(i)
.find('li')
.removeClass('slick-active')
.end();

_.$dots
.find('li')
.eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
.addClass('slick-active');
_.$dots.eq(i)
.find('li')
.eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
.addClass('slick-active');

});

}

Expand Down
Loading

0 comments on commit acb7fc6

Please sign in to comment.