fix(scroll): find delegate by historyId

Closes #2572
This commit is contained in:
Adam Bradley
2014-11-18 16:07:55 -06:00
parent bc3826d5c0
commit 46cbaf9527
6 changed files with 21 additions and 10 deletions

View File

@@ -11,7 +11,8 @@ IonicModule
'$location',
'$document',
'$ionicScrollDelegate',
function($scope, scrollViewOptions, $timeout, $window, $location, $document, $ionicScrollDelegate) {
'$ionicHistory',
function($scope, scrollViewOptions, $timeout, $window, $location, $document, $ionicScrollDelegate, $ionicHistory) {
var self = this;
// for testing
@@ -31,7 +32,7 @@ function($scope, scrollViewOptions, $timeout, $window, $location, $document, $io
var deregisterInstance = $ionicScrollDelegate._registerInstance(
self, scrollViewOptions.delegateHandle, function() {
return !$scope.$$disconnected;
return !$scope.$$disconnected && $ionicHistory.currentHistoryId() == $scope.$historyId;
}
);