diff --git a/js/ext/angular/src/directive/ionicContent.js b/js/ext/angular/src/directive/ionicContent.js index a93a4f2aca..3de74f1331 100644 --- a/js/ext/angular/src/directive/ionicContent.js +++ b/js/ext/angular/src/directive/ionicContent.js @@ -70,6 +70,20 @@ angular.module('ionic.ui.content', []) // Otherwise, supercharge this baby! // Add timeout to let content render so Scroller.resize grabs the right content height $timeout(function() { + + // Add watch to the container element's height to fire Scroller.resize event + $scope.$watch + ( + function () { + return typeof($element) !== "undefined" && $element.length > 0 && $element[0].clientHeight > 0 ? $element[0].clientHeight : 0; + }, + function (newValue, oldValue) { + if (newValue != oldValue && $scope.$parent && $scope.$parent.scrollView && $scope.$parent.scrollView.resize) { + $scope.$parent.scrollView.resize(); + } + } + ); + sv = new ionic.views.Scroller({ el: $element[0] }); @@ -87,7 +101,9 @@ angular.module('ionic.ui.content', []) */ // Let child scopes access this $scope.$parent.scrollView = sv; - }, 100); + }, 500); + + }