diff --git a/js/angular/directive/slideBox.js b/js/angular/directive/slideBox.js index 4d02e793334..58f72dc6d28 100644 --- a/js/angular/directive/slideBox.js +++ b/js/angular/directive/slideBox.js @@ -129,7 +129,10 @@ function($timeout, $compile, $ionicSlideBoxDelegate, $ionicHistory, $ionicScroll return $ionicHistory.isActiveScope($scope); } ); - $scope.$on('$destroy', deregisterInstance); + $scope.$on('$destroy', function() { + deregisterInstance(); + slider.kill(); + }); this.slidesCount = function() { return slider.slidesCount(); diff --git a/js/views/sliderView.js b/js/views/sliderView.js index d04d2368b90..fedd82e9379 100644 --- a/js/views/sliderView.js +++ b/js/views/sliderView.js @@ -544,17 +544,8 @@ ionic.views.Slider = ionic.views.View.inherit({ element.style.width = ''; element.style.left = ''; - // reset slides - var pos = slides.length; - while(pos--) { - - var slide = slides[pos]; - slide.style.width = ''; - slide.style.left = ''; - - if (browser.transitions) translate(pos, 0, 0); - - } + // reset slides so no refs are held on to + slides && (slides.length = 0); // removed event listeners if (browser.addEventListener) { diff --git a/test/html/slideBox.html b/test/html/slideBox.html index cfaf2f7e29a..b5ab2b2b9f7 100644 --- a/test/html/slideBox.html +++ b/test/html/slideBox.html @@ -46,8 +46,17 @@
- - + +
+ Toggle +
+
+

Thank you for choosing the Awesome App!