Skip to content

Commit 4f5cf00

Browse files
author
Jarek Tomanek
committed
fix(items): ensure continuous animation when navigating back
1 parent 30be9f3 commit 4f5cf00

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

dist/js/multi-carousel.directive.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
// that the last item is moved to the begining.
4646
scope.items.unshift(scope.items.pop());
4747

48+
// Ensures continuity during navigation
49+
// when there's only one invisible item
50+
scope.items = scope.items.concat(angular.copy(scope.items));
51+
4852
$interval.cancel(interval);
4953
interval = $interval(function() {
5054
if (enabled && scope.items.length && scope.$eval(attrs.interval)) {

src/js/multi-carousel.directive.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
// that the last item is moved to the begining.
4646
scope.items.unshift(scope.items.pop());
4747

48+
// Ensures continuity during navigation
49+
// when there's only one invisible item
50+
scope.items = scope.items.concat(angular.copy(scope.items));
51+
4852
$interval.cancel(interval);
4953
interval = $interval(function() {
5054
if (enabled && scope.items.length && scope.$eval(attrs.interval)) {

0 commit comments

Comments
 (0)