Skip to content

Commit

Permalink
fix(items): ensure continuous animation when navigating back
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarek Tomanek committed Aug 9, 2016
1 parent 1ddb847 commit 93a3d6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/js/multi-carousel.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
// that the last item is moved to the begining.
scope.items.unshift(scope.items.pop());

// Ensures continuity during navigation
// when there's only one invisible item
scope.items = scope.items.concat(angular.copy(scope.items));

$interval.cancel(interval);
interval = $interval(function() {
if (enabled && scope.items.length && scope.$eval(attrs.interval)) {
Expand Down
4 changes: 4 additions & 0 deletions src/js/multi-carousel.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
// that the last item is moved to the begining.
scope.items.unshift(scope.items.pop());

// Ensures continuity during navigation
// when there's only one invisible item
scope.items = scope.items.concat(angular.copy(scope.items));

$interval.cancel(interval);
interval = $interval(function() {
if (enabled && scope.items.length && scope.$eval(attrs.interval)) {
Expand Down

0 comments on commit 93a3d6d

Please sign in to comment.