fix(scroll): $historyId should default to root

This commit is contained in:
Adam Bradley
2014-11-18 21:07:15 -06:00
parent 46cbaf9527
commit 00aa24fc7f
2 changed files with 11 additions and 2 deletions

View File

@@ -32,7 +32,16 @@ function($scope, scrollViewOptions, $timeout, $window, $location, $document, $io
var deregisterInstance = $ionicScrollDelegate._registerInstance(
self, scrollViewOptions.delegateHandle, function() {
return !$scope.$$disconnected && $ionicHistory.currentHistoryId() == $scope.$historyId;
if ($scope.$$disconnected) {
return false;
}
var currentHistoryId = $ionicHistory.currentHistoryId();
if (currentHistoryId) {
return currentHistoryId == (isDefined($scope.$historyId) ? $scope.$historyId : 'root');
}
return true;
}
);

View File

@@ -644,7 +644,7 @@ function($rootScope, $state, $location, $document, $ionicPlatform, $ionicHistory
// always reset the keyboard state when change stage
$rootScope.$on('$stateChangeStart', function() {
ionic.keyboard.hide();
ionic.keyboard && ionic.keyboard.hide && ionic.keyboard.hide();
});
$rootScope.$on('$ionicHistory.change', function(e, data) {