fix(scrollView): higher velocity threshold for sliding

This commit is contained in:
Max Lynch
2015-02-04 09:58:58 -06:00
parent a7b8944479
commit 93643c4127

View File

@@ -328,6 +328,12 @@ ionic.views.Scroll = ionic.views.View.inherit({
/** duration for animations triggered by scrollTo/zoomTo */
animationDuration: 250,
/** The velocity required to make the scroll view "slide" after touchend */
decelVelocityThreshold: 4,
/** The velocity required to make the scroll view "slide" after touchend when using paging */
decelVelocityThresholdPaging: 4,
/** Enable bouncing (content can be slowly moved outside and jumps back after releasing) */
bouncing: true,
@@ -1965,7 +1971,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
self.__decelerationVelocityY = movedTop / timeOffset * (1000 / 60);
// How much velocity is required to start the deceleration
var minVelocityToStartDeceleration = self.options.paging || self.options.snapping ? 4 : 1;
var minVelocityToStartDeceleration = self.options.paging || self.options.snapping ? self.options.decelVelocityThresholdPaging : self.options.decelVelocityThreshold;
// Verify that we have enough velocity to start deceleration
if (Math.abs(self.__decelerationVelocityX) > minVelocityToStartDeceleration || Math.abs(self.__decelerationVelocityY) > minVelocityToStartDeceleration) {