From 1fd7be878507ae5390e0236003cb9f63cf7fa928 Mon Sep 17 00:00:00 2001 From: Travis Russi Date: Sat, 30 Nov 2013 16:57:56 -0800 Subject: [PATCH] added Math.min in case the parent is smaller --- js/ext/angular/src/directive/ionicContent.js | 9 +++++---- js/views/scrollZyng.js | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/js/ext/angular/src/directive/ionicContent.js b/js/ext/angular/src/directive/ionicContent.js index 384c4d8880..a93a4f2aca 100644 --- a/js/ext/angular/src/directive/ionicContent.js +++ b/js/ext/angular/src/directive/ionicContent.js @@ -62,7 +62,11 @@ angular.module('ionic.ui.content', []) addedPadding = true; } $element.append(sc); - + + // Pass the parent scope down to the child + clone = transclude($scope.$parent); + angular.element($element[0].firstElementChild).append(clone); + // Otherwise, supercharge this baby! // Add timeout to let content render so Scroller.resize grabs the right content height $timeout(function() { @@ -85,9 +89,6 @@ angular.module('ionic.ui.content', []) $scope.$parent.scrollView = sv; }, 100); - // Pass the parent scope down to the child - clone = transclude($scope.$parent); - angular.element($element[0].firstElementChild).append(clone); } // if padding attribute is true, then add padding if it wasn't added to the .scroll diff --git a/js/views/scrollZyng.js b/js/views/scrollZyng.js index ecaaaf5c6f..680795b547 100644 --- a/js/views/scrollZyng.js +++ b/js/views/scrollZyng.js @@ -583,7 +583,11 @@ var Scroller; resize: function() { // Update Scroller dimensions for changed content // Add padding to bottom of content - this.setDimensions(this.__container.clientWidth, this.__container.clientHeight, this.__content.offsetWidth, this.__content.offsetHeight+50); + this.setDimensions( + Math.min(this.__container.clientWidth, this.__container.parentElement.clientWidth), + Math.min(this.__container.clientHeight, this.__container.parentElement.clientHeight), + this.__content.offsetWidth, + this.__content.offsetHeight+50); }, /* ---------------------------------------------------------------------------