Skip to content

Commit

Permalink
Erroneous check for options=false in destroy method.
Browse files Browse the repository at this point in the history
Because the responsive method mutates the _.options object, the check for
_.options.arrows in the destroy method was actually always opposite to the
truth when the arrows value changes as it was taking the value from the
previous breakpoint.

Fixed.

fixes #1536 - @wjthomas9
#1536 (comment)
  • Loading branch information
simeydotme committed Jul 24, 2015
1 parent b50ff5b commit 3d82c5b
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions slick/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,34 +827,33 @@
_.$dots.remove();
}

if ( _.options.arrows === true ) {

if ( _.$prevArrow && _.$prevArrow.length ) {
if ( _.$prevArrow && _.$prevArrow.length ) {

_.$prevArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css("display","");
_.$prevArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css("display","");

if ( _.htmlExpr.test( _.options.prevArrow )) {
_.$prevArrow.remove();
}
if ( _.htmlExpr.test( _.options.prevArrow )) {
_.$prevArrow.remove();
}
}

if ( _.$nextArrow && _.$nextArrow.length ) {
if ( _.$nextArrow && _.$nextArrow.length ) {

_.$nextArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css("display","");
_.$nextArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css("display","");

if ( _.htmlExpr.test( _.options.nextArrow )) {
_.$nextArrow.remove();
}
if ( _.htmlExpr.test( _.options.nextArrow )) {
_.$nextArrow.remove();
}

}


if (_.$slides) {

_.$slides
Expand Down

0 comments on commit 3d82c5b

Please sign in to comment.