Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(carousel): use proper sort comparison
Browse files Browse the repository at this point in the history
Fixes #5638
Closes #5702
  • Loading branch information
charlierudolph authored and deeg committed Mar 28, 2016
1 parent 48f62a6 commit 434c1c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ angular.module('ui.bootstrap.carousel', [])
element: element
});
slides.sort(function(a, b) {
return +a.slide.index > +b.slide.index;
return +a.slide.index - +b.slide.index;
});
//if this is the first slide or the slide is set to active, select it
if (slide.index === $scope.active || slides.length === 1 && !angular.isNumber($scope.active)) {
Expand Down

0 comments on commit 434c1c5

Please sign in to comment.