diff --git a/js/angular/controller/scrollController.js b/js/angular/controller/scrollController.js index 8b659635f8..5bf28e0c33 100644 --- a/js/angular/controller/scrollController.js +++ b/js/angular/controller/scrollController.js @@ -61,7 +61,7 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca $scope.$on('$destroy', function() { deregisterInstance(); - scrollView.__removeEventHandlers(); + scrollView.__cleanup(); ionic.off('resize', resize, $window); $window.removeEventListener('resize', resize); backListenDone(); diff --git a/js/angular/directive/content.js b/js/angular/directive/content.js index 1e425b09ab..935033fcc8 100644 --- a/js/angular/directive/content.js +++ b/js/angular/directive/content.js @@ -109,26 +109,31 @@ function($timeout, $controller, $ionicBind) { } else if(attr.overflowScroll === "true") { $element.addClass('overflow-scroll'); } else { + var scrollViewOptions = { + el: $element[0], + delegateHandle: attr.delegateHandle, + bouncing: $scope.$eval($scope.hasBouncing), + startX: $scope.$eval($scope.startX) || 0, + startY: $scope.$eval($scope.startY) || 0, + scrollbarX: $scope.$eval($scope.scrollbarX) !== false, + scrollbarY: $scope.$eval($scope.scrollbarY) !== false, + scrollingX: $scope.direction.indexOf('x') >= 0, + scrollingY: $scope.direction.indexOf('y') >= 0, + scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 10, + scrollingComplete: function() { + $scope.$onScrollComplete({ + scrollTop: this.__scrollTop, + scrollLeft: this.__scrollLeft + }); + } + }; $controller('$ionicScroll', { $scope: $scope, - scrollViewOptions: { - el: $element[0], - delegateHandle: attr.delegateHandle, - bouncing: $scope.$eval($scope.hasBouncing), - startX: $scope.$eval($scope.startX) || 0, - startY: $scope.$eval($scope.startY) || 0, - scrollbarX: $scope.$eval($scope.scrollbarX) !== false, - scrollbarY: $scope.$eval($scope.scrollbarY) !== false, - scrollingX: $scope.direction.indexOf('x') >= 0, - scrollingY: $scope.direction.indexOf('y') >= 0, - scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 10, - scrollingComplete: function() { - $scope.$onScrollComplete({ - scrollTop: this.__scrollTop, - scrollLeft: this.__scrollLeft - }); - } - } + scrollViewOptions: scrollViewOptions + }); + + $scope.$on('$destroy', function() { + scrollViewOptions.scrollingComplete = angular.noop; }); } diff --git a/js/angular/directive/view.js b/js/angular/directive/view.js index b0fd77bc47..88a89baa79 100644 --- a/js/angular/directive/view.js +++ b/js/angular/directive/view.js @@ -37,6 +37,7 @@ IonicModule priority: 1000, require: ['^?ionNavBar', '^?ionModal'], compile: function(tElement, tAttrs, transclude) { + if(1) return; tElement.addClass('pane'); tElement[0].removeAttribute('title'); diff --git a/js/angular/service/collectionRepeatManager.js b/js/angular/service/collectionRepeatManager.js index 9b79b7e817..3692b3f4c8 100644 --- a/js/angular/service/collectionRepeatManager.js +++ b/js/angular/service/collectionRepeatManager.js @@ -296,7 +296,7 @@ function($rootScope, $timeout) { var rect = self.dimensions[dataIndex]; if (!rect) { - }else if (dataIndex < self.dataSource.dataStartIndex) { + } else if (dataIndex < self.dataSource.dataStartIndex) { // do nothing } else { self.renderItem(dataIndex, rect.primaryPos - self.beforeSize, rect.secondaryPos); diff --git a/js/views/scrollView.js b/js/views/scrollView.js index 8183f58c3a..2a1969ba99 100644 --- a/js/views/scrollView.js +++ b/js/views/scrollView.js @@ -781,12 +781,6 @@ ionic.views.Scroll = ionic.views.View.inherit({ } }; - self.options.orgScrollingComplete = self.options.scrollingComplete; - self.options.scrollingComplete = function() { - ionic.tap.removeClonedInputs(container, self); - self.options.orgScrollingComplete(); - }; - if ('ontouchstart' in window) { // Touch Events container.addEventListener("touchstart", self.touchStart, false); @@ -869,7 +863,7 @@ ionic.views.Scroll = ionic.views.View.inherit({ } }, - __removeEventHandlers: function() { + __cleanup: function() { var container = this.__container; container.removeEventListener('touchstart', self.touchStart); @@ -891,6 +885,11 @@ ionic.views.Scroll = ionic.views.View.inherit({ document.removeEventListener("mousemove", self.mouseMove); document.removeEventListener("mouseup", self.mouseUp); document.removeEventListener('mousewheel', self.mouseWheel); + + delete this.__container; + delete this.__content; + delete this.__indicatorX; + delete this.__indicatorY; }, /** Create a scroll bar div with the given direction **/ @@ -1090,6 +1089,7 @@ ionic.views.Scroll = ionic.views.View.inherit({ __scrollingComplete: function() { var self = this; self.options.scrollingComplete(); + ionic.tap.removeClonedInputs(container, self); self.__fadeScrollbars('out'); },