Skip to content

Commit 669c9ad

Browse files
committed
End to End Swiping & Set of images
1 parent cbe4dfd commit 669c9ad

File tree

4 files changed

+132
-4
lines changed

4 files changed

+132
-4
lines changed

dist/angular-carousel.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Angular Carousel - Mobile friendly touch carousel for AngularJS
3-
* @version v0.3.10 - 2015-02-11
3+
* @version v0.3.10 - 2015-04-04
44
* @link http://revolunet.github.com/angular-carousel
55
* @author Julien Bouquillon <[email protected]>
66
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -485,7 +485,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
485485
scope.$parent.$watch(indexModel, function(newValue, oldValue) {
486486

487487
if (newValue !== undefined && newValue !== null) {
488-
if (currentSlides && newValue >= currentSlides.length) {
488+
if (currentSlides && currentSlides.length > 0 && newValue >= currentSlides.length) {
489489
newValue = currentSlides.length - 1;
490490
updateParentIndex(newValue);
491491
} else if (currentSlides && newValue < 0) {
@@ -547,6 +547,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
547547
function swipeEnd(coords, event, forceAnimation) {
548548
// console.log('swipeEnd', 'scope.carouselIndex', scope.carouselIndex);
549549
// Prevent clicks on buttons inside slider to trigger "swipeEnd" event on touchend/mouseup
550+
// console.log(iAttributes.rnCarouselOnInfiniteScroll);
550551
if (event && !swipeMoved) {
551552
return;
552553
}
@@ -574,10 +575,23 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
574575
slidesMove = -scope.carouselIndex;
575576
}
576577
var moveOffset = shouldMove ? slidesMove : 0;
578+
579+
console.log("scope.carouselIndex = " + scope.carouselIndex);
580+
console.log("moveOffset = " + moveOffset);
581+
console.log("slidesMove = " + slidesMove);
577582

578583
destination = (scope.carouselIndex + moveOffset);
579584

580585
goToSlide(destination);
586+
if(iAttributes.rnCarouselOnInfiniteScrollRight!==undefined && slidesMove === 0 && scope.carouselIndex !== 0) {
587+
eval("scope." + iAttributes.rnCarouselOnInfiniteScrollRight);
588+
goToSlide(0);
589+
}
590+
if(iAttributes.rnCarouselOnInfiniteScrollLeft!==undefined && slidesMove === 0 && scope.carouselIndex === 0 && moveOffset === 0) {
591+
eval("scope." + iAttributes.rnCarouselOnInfiniteScrollLeft);
592+
goToSlide(currentSlides.length);
593+
}
594+
581595
} else {
582596
scope.$apply(function() {
583597
scope.carouselIndex = parseInt(-offset / 100, 10);

0 commit comments

Comments
 (0)