Skip to content

Commit

Permalink
Check for htmlExpr in unload() method
Browse files Browse the repository at this point in the history
Based on a comment from @nominalaeon I noticed there was a oversight in
the unload method, any arrows which were set in the options as a jquery
selector-string were being removed from the DOM and never replaced in when
a slide was added/removed, or setOption was run, or the slides were
filtered.

Fixed.
  • Loading branch information
simeydotme committed May 23, 2015
1 parent a5daeb6 commit 72fee79
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions slick/slick.js
Expand Up @@ -2288,16 +2288,23 @@
var _ = this;

$('.slick-cloned', _.$slider).remove();

if (_.$dots) {
_.$dots.remove();
}
if (_.$prevArrow && (typeof _.options.prevArrow !== 'object')) {

if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.remove();
}
if (_.$nextArrow && (typeof _.options.nextArrow !== 'object')) {

if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.remove();
}
_.$slides.removeClass('slick-slide slick-active slick-visible').attr("aria-hidden", "true").css('width', '');

_.$slides
.removeClass('slick-slide slick-active slick-visible')
.attr("aria-hidden", "true")
.css('width', '');

};

Expand Down

0 comments on commit 72fee79

Please sign in to comment.