yui/yui3 — pull request #258 by derek (2012-09-13 08:32:20+00:00)
Title: Fixes #2532745 - Support flick._minVelocity and drag distance thresholds in ScrollView Paginator

This is a follow-up pull request to discussion @ https://github.com/yui/yui3/pull/250/#issuecomment-8466599. Trac ticket [#2532745](http://yuilibrary.com/projects/yui3/ticket/2532745/)

ScrollView's Paginator plugin previously respected a `minVelocity` value to trigger a page change, but this was left out of the 3.7.0 cleanup as a preference for more simple code. However, it was discussed that this should probably be reintroduced.

Also left out was a drag distance threshold as a minimum for page change. So for example, on a 500px widget, previously the distance dragged would need to be >=250px to trigger a page change, otherwise it would snap back. But in 3.7.0 this could be triggered with just a 1px drag. Arguments can be made for either behavior, and it should probably be a configurable value, but to respect backwards compatibility until it can be researched further, it has been reintroduced.

These two related updates are primarily confined to two methods inside `paginator-plugin.js`

* `_beforeHostFlick` - Reacts to the flick behavior, which is now responsible for handling pagination instead of deferring to the drag listener. Additional logic has been added to determine ability to scroll on the paginator's axis, as well as determining pagination direction. This method will prevent ScrollView's `flick` listener from firing, since the post-drag action is already determined (a page).
* `_afterHostGestureMoveEnd` - Reacts to drag events. Additional logic added to determine the distance of the drag, and compare that to the halfway point of the page node's width/height.

When reintroducing code/logic, it can sometimes be helpful to compare old vs new. They are not directly comparable because different `on`/`after` calls, as well as the host methods doing slightly different things as well. But for the curious:

3.6.0 [_flickFrame](https://github.com/yui/yui3/blob/v3.6.0/src/scrollview/js/paginator-plugin.js#L181)
3.7.0 [_beforeHostFlick](https://github.com/derek/yui3/blob/sv_flick_page/src/scrollview/js/paginator-plugin.js#L340)

3.6.0 [_onGestureMoveEnd](https://github.com/yui/yui3/blob/v3.6.0/src/scrollview/js/paginator-plugin.js#L167)
3.7.0 [_afterHostGestureMoveEnd](https://github.com/derek/yui3/blob/sv_flick_page/src/scrollview/js/paginator-plugin.js#L261)

A few additional notes
* In the more aggressive flick testing for this update, an unrelated issue was discovered where the widget's `_maxScroll{X/Y}` values could be reset to zero, subsequently preventing normal interaction with ScrollView. This was due to some logic specifically for dual-axis instances but was not wrapped in a check to ensure it was dual-axis. Fixed, [line #426](https://github.com/derek/yui3/blob/sv_flick_page/src/scrollview/js/paginator-plugin.js#L426).
* To provide maximum time for review before code freeze, full testing will be done in parallel to code review. It has been tested so far in Firefox, Chrome, and iOS, and a full test will be completed before merge.