Skip to content

Commit

Permalink
Merge pull request #55 from juliangarnier/master
Browse files Browse the repository at this point in the history
Let the user stop and hold the page during a bounce
  • Loading branch information
pbakaus committed Jun 6, 2016
2 parents a21f4dc + 9c66390 commit a99b5a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var Scroller;
provided that another scrolling action has not begun. Used to know
when to fade out a scrollbar. */
scrollingComplete: NOOP,

/** This configures the amount of change applied to deceleration when reaching boundaries **/
penetrationDeceleration : 0.03,

Expand Down Expand Up @@ -595,7 +595,9 @@ var Scroller;
}

// Publish new values
self.__publish(left, top, zoom, animate);
if (!self.__isTracking) {
self.__publish(left, top, zoom, animate);
}

},

Expand Down Expand Up @@ -1197,7 +1199,7 @@ var Scroller;
};

// How much velocity is required to keep the deceleration running
var minVelocityToKeepDecelerating = self.options.snapping ? 4 : 0.1;
var minVelocityToKeepDecelerating = self.options.snapping ? 4 : 0.001;

// Detect whether it's still worth to continue animating steps
// If we are already slow enough to not being user perceivable anymore, we stop the whole process here.
Expand Down Expand Up @@ -1309,8 +1311,8 @@ var Scroller;
var scrollOutsideY = 0;

// This configures the amount of change applied to deceleration/acceleration when reaching boundaries
var penetrationDeceleration = self.options.penetrationDeceleration;
var penetrationAcceleration = self.options.penetrationAcceleration;
var penetrationDeceleration = self.options.penetrationDeceleration;
var penetrationAcceleration = self.options.penetrationAcceleration;

// Check limits
if (scrollLeft < self.__minDecelerationScrollLeft) {
Expand Down

0 comments on commit a99b5a9

Please sign in to comment.