mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fixed resize issue for scrolling
This commit is contained in:
40
js/ext/angular/src/directive/ionicContent.js
vendored
40
js/ext/angular/src/directive/ionicContent.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user