Skip to content

Commit d643bb3

Browse files
committed
add rn-carousel-controls-allow-loop info in README
1 parent 2446f58 commit d643bb3

5 files changed

+10
-8
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ angular.module('MyApp', ['angular-carousel']);
5252
- `rn-carousel-deep-watch`: Deep watch the collection which enable to dynamically add slides at beginning without corrupting position
5353
- `rn-carousel-easing`: add this attritube to specify a formula for easing, these can be found in the [shifty
5454
library](https://github.com/jeremyckahn/shifty/blob/master/src/shifty.formulas.js) (default=easeIn)
55-
- `rn-carousel-duration`: add this attritube to set the duration of the transition (default=300)
55+
- `rn-carousel-duration`: add this attribute to set the duration of the transition (default=300)
56+
- `rn-carousel-controls-allow-loop`: add this attribute to allow looping through slides from prev/next controls
5657

5758
## Indicators
5859

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-carousel",
33
"description": "Angular Carousel - Mobile friendly touch carousel for AngularJS",
4-
"version": "0.3.12",
4+
"version": "0.3.13",
55
"homepage": "http://revolunet.github.com/angular-carousel",
66
"author": "Julien Bouquillon <[email protected]>",
77
"repository": {

dist/angular-carousel.js

+4-3
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.12 - 2015-06-11
3+
* @version v0.3.13 - 2015-06-15
44
* @link http://revolunet.github.com/angular-carousel
55
* @author Julien Bouquillon <[email protected]>
66
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -453,10 +453,11 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
453453

454454
if (iAttributes.rnCarouselControls!==undefined) {
455455
// dont use a directive for this
456+
var canloop = ((isRepeatBased ? scope[repeatCollection.replace('::', '')].length : currentSlides.length) > 1) ? angular.isDefined(tAttributes['rnCarouselControlsAllowLoop']) : false;
456457
var nextSlideIndexCompareValue = isRepeatBased ? repeatCollection.replace('::', '') + '.length - 1' : currentSlides.length - 1;
457458
var tpl = '<div class="rn-carousel-controls">\n' +
458-
' <span class="rn-carousel-control rn-carousel-control-prev" ng-click="prevSlide()" ng-if="carouselIndex > 0"></span>\n' +
459-
' <span class="rn-carousel-control rn-carousel-control-next" ng-click="nextSlide()" ng-if="carouselIndex < ' + nextSlideIndexCompareValue + '"></span>\n' +
459+
' <span class="rn-carousel-control rn-carousel-control-prev" ng-click="prevSlide()" ng-if="carouselIndex > 0 || ' + canloop + '"></span>\n' +
460+
' <span class="rn-carousel-control rn-carousel-control-next" ng-click="nextSlide()" ng-if="carouselIndex < ' + nextSlideIndexCompareValue + ' || ' + canloop + '"></span>\n' +
460461
'</div>';
461462
iElement.parent().append($compile(angular.element(tpl))(scope));
462463
}

0 commit comments

Comments
 (0)