mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
added Math.min in case the parent is smaller
This commit is contained in:
9
js/ext/angular/src/directive/ionicContent.js
vendored
9
js/ext/angular/src/directive/ionicContent.js
vendored
@@ -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
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user