File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2024,17 +2024,23 @@ ionic.views.Scroll = ionic.views.View.inherit({
2024
2024
2025
2025
// Slow down until slow enough, then flip back to snap position
2026
2026
if ( scrollOutsideX !== 0 ) {
2027
- if ( scrollOutsideX * self . __decelerationVelocityX <= self . __minDecelerationScrollLeft ) {
2027
+ var isHeadingOutwardsX = scrollOutsideX * self . __decelerationVelocityX <= self . __minDecelerationScrollLeft ;
2028
+ if ( isHeadingOutwardsX ) {
2028
2029
self . __decelerationVelocityX += scrollOutsideX * penetrationDeceleration ;
2029
- } else {
2030
+ }
2031
+ //If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
2032
+ if ( ! isHeadingOutwardsX || self . __decelerationVelocityX <= self . __minDecelerationScrollLeft ) {
2030
2033
self . __decelerationVelocityX = scrollOutsideX * penetrationAcceleration ;
2031
2034
}
2032
2035
}
2033
2036
2034
2037
if ( scrollOutsideY !== 0 ) {
2035
- if ( scrollOutsideY * self . __decelerationVelocityY <= self . __minDecelerationScrollTop ) {
2038
+ var isHeadingOutwardsY = scrollOutsideY * self . __decelerationVelocityY <= self . __minDecelerationScrollTop ;
2039
+ if ( isHeadingOutwardsY ) {
2036
2040
self . __decelerationVelocityY += scrollOutsideY * penetrationDeceleration ;
2037
- } else {
2041
+ }
2042
+ //If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
2043
+ if ( ! isHeadingOutwardsY || self . __decelerationVelocityY <= self . __minDecelerationScrollTop ) {
2038
2044
self . __decelerationVelocityY = scrollOutsideY * penetrationAcceleration ;
2039
2045
}
2040
2046
}
You can’t perform that action at this time.
0 commit comments