refactor(scrollView): restart scroll if stopped, + or -

Addresses #482
This commit is contained in:
Andy Joslin
2014-02-12 07:35:08 -05:00
parent 82c2089b41
commit 63b0a31970

View File

@@ -2028,8 +2028,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
if (isHeadingOutwardsX) {
self.__decelerationVelocityX += scrollOutsideX * penetrationDeceleration;
}
var isStoppedX = Math.abs(self.__decelerationVelocityX) <= self.__minDecelerationScrollLeft;
//If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
if (!isHeadingOutwardsX || self.__decelerationVelocityX <= self.__minDecelerationScrollLeft) {
if (!isHeadingOutwardsX || isStoppedX) {
self.__decelerationVelocityX = scrollOutsideX * penetrationAcceleration;
}
}
@@ -2039,8 +2040,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
if (isHeadingOutwardsY) {
self.__decelerationVelocityY += scrollOutsideY * penetrationDeceleration;
}
var isStoppedY = Math.abs(self.__decelerationVelocityY) <= self.__minDecelerationScrollTop;
//If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
if (!isHeadingOutwardsY || self.__decelerationVelocityY <= self.__minDecelerationScrollTop) {
if (!isHeadingOutwardsY || isStoppedY) {
self.__decelerationVelocityY = scrollOutsideY * penetrationAcceleration;
}
}