Fixed #296 - scrollview dynamic sizing

This commit is contained in:
Max Lynch
2013-12-08 20:34:27 -06:00
parent c08007d248
commit 2e87fe306e
10 changed files with 143 additions and 6 deletions

View File

@@ -346,6 +346,10 @@ ionic.views.Scroll = ionic.views.View.inherit({
this.options[key] = options[key];
}
this.hintResize = ionic.debounce(function() {
self.resize();
}, 1000, true);
this.triggerScrollEvent = ionic.throttle(function() {
ionic.trigger('scroll', {
scrollTop: self.__scrollTop,
@@ -606,8 +610,8 @@ ionic.views.Scroll = ionic.views.View.inherit({
// Update Scroller dimensions for changed content
// Add padding to bottom of content
this.setDimensions(
Math.min(this.__container.clientWidth, this.__container.parentElement.clientWidth),
Math.min(this.__container.clientHeight, this.__container.parentElement.clientHeight),
this.__container.clientWidth,
this.__container.clientHeight,
this.__content.offsetWidth,
this.__content.offsetHeight+20);
},
@@ -1039,6 +1043,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
* Touch start handler for scrolling support
*/
doTouchStart: function(touches, timeStamp) {
this.hintResize();
// Array-like check is enough here
if (touches.length == null) {