From 5fb30216cee8005c4f2b88d956ece47f14ae3cf1 Mon Sep 17 00:00:00 2001 From: tariqporter Date: Tue, 13 Dec 2016 18:40:57 -0500 Subject: [PATCH] Remove Buffered Transitions array --- src/carousel/carousel.js | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index 12fb6f188c..aaa04f8a95 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -5,7 +5,7 @@ angular.module('ui.bootstrap.carousel', []) slides = self.slides = $scope.slides = [], SLIDE_DIRECTION = 'uib-slideDirection', currentIndex = $scope.active, - currentInterval, isPlaying, bufferedTransitions = []; + currentInterval, isPlaying; var destroyed = false; $element.addClass('carousel'); @@ -67,11 +67,6 @@ angular.module('ui.bootstrap.carousel', []) self.removeSlide = function(slide) { var index = findSlideIndex(slide); - var bufferedIndex = bufferedTransitions.indexOf(slides[index]); - if (bufferedIndex !== -1) { - bufferedTransitions.splice(bufferedIndex, 1); - } - //get the index of the slide inside the carousel slides.splice(index, 1); if (slides.length > 0 && currentIndex === index) { @@ -95,7 +90,6 @@ angular.module('ui.bootstrap.carousel', []) if (slides.length === 0) { currentIndex = null; $scope.active = null; - clearBufferedTransitions(); } }; @@ -110,8 +104,6 @@ angular.module('ui.bootstrap.carousel', []) if (nextSlide.slide.index !== currentIndex && !$scope.$currentTransition) { goNext(nextSlide.slide, nextIndex, direction); - } else if (nextSlide && nextSlide.slide.index !== currentIndex && $scope.$currentTransition) { - bufferedTransitions.push(slides[nextIndex]); } }; @@ -180,12 +172,6 @@ angular.module('ui.bootstrap.carousel', []) } }); - function clearBufferedTransitions() { - while (bufferedTransitions.length) { - bufferedTransitions.shift(); - } - } - function getSlideByIndex(index) { for (var i = 0, l = slides.length; i < l; ++i) { if (slides[i].index === index) { @@ -221,14 +207,6 @@ angular.module('ui.bootstrap.carousel', []) if (phase === 'close') { $scope.$currentTransition = null; $animate.off('addClass', element); - if (bufferedTransitions.length) { - var nextSlide = bufferedTransitions.pop().slide; - var nextIndex = nextSlide.index; - var nextDirection = nextIndex > self.getCurrentIndex() ? 'next' : 'prev'; - clearBufferedTransitions(); - - goNext(nextSlide, nextIndex, nextDirection); - } } }); } @@ -259,7 +237,6 @@ angular.module('ui.bootstrap.carousel', []) function resetTransition(slides) { if (!slides.length) { $scope.$currentTransition = null; - clearBufferedTransitions(); } }