summaryrefslogtreecommitdiff
path: root/www/lib/angular-carousel/src/directives/rn-carousel-auto-slide.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/lib/angular-carousel/src/directives/rn-carousel-auto-slide.js')
-rw-r--r--www/lib/angular-carousel/src/directives/rn-carousel-auto-slide.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/www/lib/angular-carousel/src/directives/rn-carousel-auto-slide.js b/www/lib/angular-carousel/src/directives/rn-carousel-auto-slide.js
deleted file mode 100644
index a2e1a5fd..00000000
--- a/www/lib/angular-carousel/src/directives/rn-carousel-auto-slide.js
+++ /dev/null
@@ -1,31 +0,0 @@
-angular.module('angular-carousel')
-
-.directive('rnCarouselAutoSlide', ['$interval', function($interval) {
- return {
- restrict: 'A',
- link: function (scope, element, attrs) {
- var stopAutoPlay = function() {
- if (scope.autoSlider) {
- $interval.cancel(scope.autoSlider);
- scope.autoSlider = null;
- }
- };
- var restartTimer = function() {
- scope.autoSlide();
- };
-
- scope.$watch('carouselIndex', restartTimer);
-
- if (attrs.hasOwnProperty('rnCarouselPauseOnHover') && attrs.rnCarouselPauseOnHover !== 'false'){
- element.on('mouseenter', stopAutoPlay);
- element.on('mouseleave', restartTimer);
- }
-
- scope.$on('$destroy', function(){
- stopAutoPlay();
- element.off('mouseenter', stopAutoPlay);
- element.off('mouseleave', restartTimer);
- });
- }
- };
-}]);