Don't momentum if no pixel change Fixed #61

This commit is contained in:
Max Lynch
2013-10-28 22:10:11 -05:00
parent f3bec7f759
commit 5b618ffdd9
3 changed files with 12 additions and 2 deletions

7
dist/js/ionic.js vendored
View File

@ -2847,7 +2847,7 @@ window.ionic = {
var scrollTop = e.scrollTop; var scrollTop = e.scrollTop;
var highWater = Math.max(0, e.scrollTop + this.virtualRemoveThreshold); var highWater = Math.max(0, e.scrollTop + this.virtualRemoveThreshold);
var lowWater = Math.min(scrollHeight - viewportHeight, Math.abs(e.scrollTop) + viewportHeight + this.virtualAddThreshold); var lowWater = Math.min(scrollHeight, Math.abs(e.scrollTop) + viewportHeight + this.virtualAddThreshold);
var itemsPerViewport = Math.floor((lowWater - highWater) / itemHeight); var itemsPerViewport = Math.floor((lowWater - highWater) / itemHeight);
var first = parseInt(Math.abs(highWater / itemHeight)); var first = parseInt(Math.abs(highWater / itemHeight));
@ -3276,6 +3276,11 @@ window.ionic = {
} else { } else {
y = this.y; y = this.y;
} }
if(ox == x && oy == y) {
time = 0;
}
var dx = ox - x; var dx = ox - x;
var dy = oy - y; var dy = oy - y;

View File

@ -414,7 +414,7 @@
var scrollTop = e.scrollTop; var scrollTop = e.scrollTop;
var highWater = Math.max(0, e.scrollTop + this.virtualRemoveThreshold); var highWater = Math.max(0, e.scrollTop + this.virtualRemoveThreshold);
var lowWater = Math.min(scrollHeight - viewportHeight, Math.abs(e.scrollTop) + viewportHeight + this.virtualAddThreshold); var lowWater = Math.min(scrollHeight, Math.abs(e.scrollTop) + viewportHeight + this.virtualAddThreshold);
var itemsPerViewport = Math.floor((lowWater - highWater) / itemHeight); var itemsPerViewport = Math.floor((lowWater - highWater) / itemHeight);
var first = parseInt(Math.abs(highWater / itemHeight)); var first = parseInt(Math.abs(highWater / itemHeight));

View File

@ -145,6 +145,11 @@
} else { } else {
y = this.y; y = this.y;
} }
if(ox == x && oy == y) {
time = 0;
}
var dx = ox - x; var dx = ox - x;
var dy = oy - y; var dy = oy - y;