summaryrefslogtreecommitdiff
path: root/www/lib/angular-carousel/src
diff options
context:
space:
mode:
Diffstat (limited to 'www/lib/angular-carousel/src')
-rwxr-xr-xwww/lib/angular-carousel/src/directives/rn-carousel.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/www/lib/angular-carousel/src/directives/rn-carousel.js b/www/lib/angular-carousel/src/directives/rn-carousel.js
index 9399643c..c4e1e4ba 100755
--- a/www/lib/angular-carousel/src/directives/rn-carousel.js
+++ b/www/lib/angular-carousel/src/directives/rn-carousel.js
@@ -374,10 +374,11 @@
if (iAttributes.rnCarouselControls!==undefined) {
// dont use a directive for this
+ var canloop = ((isRepeatBased ? scope[repeatCollection.replace('::', '')].length : currentSlides.length) > 1) ? angular.isDefined(tAttributes['rnCarouselControlsAllowLoop']) : false;
var nextSlideIndexCompareValue = isRepeatBased ? repeatCollection.replace('::', '') + '.length - 1' : currentSlides.length - 1;
var tpl = '<div class="rn-carousel-controls">\n' +
- ' <span class="rn-carousel-control rn-carousel-control-prev" ng-click="prevSlide()" ng-if="carouselIndex > 0"></span>\n' +
- ' <span class="rn-carousel-control rn-carousel-control-next" ng-click="nextSlide()" ng-if="carouselIndex < ' + nextSlideIndexCompareValue + '"></span>\n' +
+ ' <span class="rn-carousel-control rn-carousel-control-prev" ng-click="prevSlide()" ng-if="carouselIndex > 0 || ' + canloop + '"></span>\n' +
+ ' <span class="rn-carousel-control rn-carousel-control-next" ng-click="nextSlide()" ng-if="carouselIndex < ' + nextSlideIndexCompareValue + ' || ' + canloop + '"></span>\n' +
'</div>';
iElement.parent().append($compile(angular.element(tpl))(scope));
}