cubiq/iscroll — pull request #208 by faeldt (2012-05-08 06:03:36+00:00)
Title: onScrollEnd not firing if tapping to stop an ongoing momentum

Scrolling a long list and letting the momentum run its course will fire onScrollEnd as expected.

If you however tap the screen to stop the scrolling prematurely, onScrollEnd will not be fired.

The reason for this is that _start is fired again, resetting this.moved which makes _resetPos think that no movement took place. To counter this I've introduced a new variable called wasAnimating, using which _resetPos can accurately can fire onScrollEnd.

This is my first attempt at an update to this project so a harsh code review is appreciated.