Skip to content

Commit

Permalink
Fixes issue woocommerce#292 and the uniqueID method
Browse files Browse the repository at this point in the history
Multiple clones were added for no apparent reason. Also uniqueID only
fixed the id's of sub elements due to the use of find().
  • Loading branch information
wicol committed Jun 30, 2014
1 parent 01b2427 commit 14303c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jquery.flexslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,8 @@
}
},
uniqueID: function($clone) {
$clone.find( '[id]' ).each(function() {
// Append _clone to current level and children elements with id attributes
$clone.filter( '[id]' ).add($clone.find( '[id]' )).each(function() {
var $this = $(this);
$this.attr( 'id', $this.attr( 'id' ) + '_clone' );
});
Expand Down Expand Up @@ -882,9 +883,8 @@
slider.cloneOffset = 1;
// clear out old clones
if (type !== "init") slider.container.find('.clone').remove();
// slider.container.append(slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true')).prepend(slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true'));
methods.uniqueID( slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true') ).appendTo( slider.container );
methods.uniqueID( slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true') ).prependTo( slider.container );
slider.container.append(methods.uniqueID(slider.slides.first().clone().addClass('clone')).attr('aria-hidden', 'true'))
.prepend(methods.uniqueID(slider.slides.last().clone().addClass('clone')).attr('aria-hidden', 'true'));
}
slider.newSlides = $(slider.vars.selector, slider);

Expand Down

0 comments on commit 14303c7

Please sign in to comment.