mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fixed #296 - scrollview dynamic sizing
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user