1
1
/**
2
2
* Angular Carousel - Mobile friendly touch carousel for AngularJS
3
- * @version v0.3.11 - 2015-06-08
3
+ * @version v0.3.12 - 2015-06-11
4
4
* @link http://revolunet.github.com/angular-carousel
5
5
* @author Julien Bouquillon <[email protected] >
6
6
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -294,14 +294,17 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
294
294
mouseUpBound = false ,
295
295
locked = false ;
296
296
297
- $swipe . bind ( iElement , {
298
- start : swipeStart ,
299
- move : swipeMove ,
300
- end : swipeEnd ,
301
- cancel : function ( event ) {
302
- swipeEnd ( { } , event ) ;
303
- }
304
- } ) ;
297
+ //rn-swipe-disabled =true will only disable swipe events
298
+ if ( iAttributes . rnSwipeDisabled !== "true" ) {
299
+ $swipe . bind ( iElement , {
300
+ start : swipeStart ,
301
+ move : swipeMove ,
302
+ end : swipeEnd ,
303
+ cancel : function ( event ) {
304
+ swipeEnd ( { } , event ) ;
305
+ }
306
+ } ) ;
307
+ }
305
308
306
309
function getSlidesDOM ( ) {
307
310
return iElement [ 0 ] . querySelectorAll ( 'ul[rn-carousel] > li' ) ;
@@ -455,7 +458,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
455
458
' <span class="rn-carousel-control rn-carousel-control-prev" ng-click="prevSlide()" ng-if="carouselIndex > 0"></span>\n' +
456
459
' <span class="rn-carousel-control rn-carousel-control-next" ng-click="nextSlide()" ng-if="carouselIndex < ' + nextSlideIndexCompareValue + '"></span>\n' +
457
460
'</div>' ;
458
- iElement . append ( $compile ( angular . element ( tpl ) ) ( scope ) ) ;
461
+ iElement . parent ( ) . append ( $compile ( angular . element ( tpl ) ) ( scope ) ) ;
459
462
}
460
463
461
464
if ( iAttributes . rnCarouselAutoSlide !== undefined ) {
@@ -472,7 +475,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
472
475
} , duration * 1000 ) ;
473
476
} ;
474
477
}
475
-
478
+
476
479
if ( iAttributes . rnCarouselDefaultIndex ) {
477
480
var defaultIndexModel = $parse ( iAttributes . rnCarouselDefaultIndex ) ;
478
481
options . defaultIndex = defaultIndexModel ( scope . $parent ) || 0 ;
@@ -507,7 +510,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
507
510
}
508
511
} ) ;
509
512
isIndexBound = true ;
510
-
513
+
511
514
if ( options . defaultIndex ) {
512
515
goToSlide ( options . defaultIndex , {
513
516
animate : ! init
@@ -587,7 +590,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
587
590
slidesMove = - scope . carouselIndex ;
588
591
}
589
592
var moveOffset = shouldMove ? slidesMove : 0 ;
590
-
593
+
591
594
destination = ( scope . carouselIndex + moveOffset ) ;
592
595
593
596
goToSlide ( destination ) ;
@@ -599,7 +602,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
599
602
$parse ( iAttributes . rnCarouselOnInfiniteScrollLeft ) ( scope )
600
603
goToSlide ( currentSlides . length ) ;
601
604
}
602
-
605
+
603
606
} else {
604
607
scope . $apply ( function ( ) {
605
608
scope . carouselIndex = parseInt ( - offset / 100 , 10 ) ;
0 commit comments