fixed resize issue for scrolling

This commit is contained in:
Travis Russi
2013-11-30 16:24:20 -08:00
parent a5c83525f0
commit c96a46a0d7
2 changed files with 24 additions and 19 deletions

View File

@@ -18,7 +18,7 @@ angular.module('ionic.ui.content', [])
// The content directive is a core scrollable content area
// that is part of many View hierarchies
.directive('content', ['$parse', function($parse) {
.directive('content', ['$parse', '$timeout', function($parse, $timeout) {
return {
restrict: 'E',
replace: true,
@@ -62,24 +62,28 @@ angular.module('ionic.ui.content', [])
addedPadding = true;
}
$element.append(sc);
// Otherwise, supercharge this baby!
sv = new ionic.views.Scroller({
el: $element[0]
});
/*
hasPullToRefresh: (typeof $scope.onRefresh !== 'undefined'),
onRefresh: function() {
$scope.onRefresh();
$scope.$parent.$broadcast('scroll.onRefresh');
},
onRefreshOpening: function(amt) {
$scope.onRefreshOpening({amount: amt});
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
}
});
*/
// Let child scopes access this
$scope.$parent.scrollView = sv;
// Add timeout to let content render so Scroller.resize grabs the right content height
$timeout(function() {
sv = new ionic.views.Scroller({
el: $element[0]
});
/*
hasPullToRefresh: (typeof $scope.onRefresh !== 'undefined'),
onRefresh: function() {
$scope.onRefresh();
$scope.$parent.$broadcast('scroll.onRefresh');
},
onRefreshOpening: function(amt) {
$scope.onRefreshOpening({amount: amt});
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
}
});
*/
// Let child scopes access this
$scope.$parent.scrollView = sv;
}, 100);
// Pass the parent scope down to the child
clone = transclude($scope.$parent);