Skip to content

Commit

Permalink
fix(scrollView): higher velocity threshold for sliding
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Feb 4, 2015
1 parent a7b8944 commit 93643c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/views/scrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 93643c4

Please sign in to comment.