From 5b618ffdd927605918228ab720308ac090899069 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 28 Oct 2013 22:10:11 -0500 Subject: [PATCH] Don't momentum if no pixel change Fixed #61 --- dist/js/ionic.js | 7 ++++++- js/views/listViewScroll.js | 2 +- js/views/scrollView.js | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/js/ionic.js b/dist/js/ionic.js index 9cfb0319b4..34d6b2b1b9 100644 --- a/dist/js/ionic.js +++ b/dist/js/ionic.js @@ -2847,7 +2847,7 @@ window.ionic = { var scrollTop = e.scrollTop; 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 first = parseInt(Math.abs(highWater / itemHeight)); @@ -3276,6 +3276,11 @@ window.ionic = { } else { y = this.y; } + + if(ox == x && oy == y) { + time = 0; + } + var dx = ox - x; var dy = oy - y; diff --git a/js/views/listViewScroll.js b/js/views/listViewScroll.js index 267f71b2b4..2a6e116d2c 100644 --- a/js/views/listViewScroll.js +++ b/js/views/listViewScroll.js @@ -414,7 +414,7 @@ var scrollTop = e.scrollTop; 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 first = parseInt(Math.abs(highWater / itemHeight)); diff --git a/js/views/scrollView.js b/js/views/scrollView.js index 77f01ae449..a7fbc07891 100644 --- a/js/views/scrollView.js +++ b/js/views/scrollView.js @@ -145,6 +145,11 @@ } else { y = this.y; } + + if(ox == x && oy == y) { + time = 0; + } + var dx = ox - x; var dy = oy - y;