Permalink
Browse files

scrollEnd now properly fires on drag gestures in non-paginated instan…

…ces. #2532323
  • Loading branch information...
derek committed Oct 18, 2012
1 parent 25e1985 commit f847edf08d56ad801d051042a5cdd5aa20907353
Showing with 18 additions and 6 deletions.
  1. +18 −6 src/scrollview/js/scrollview-base.js
@@ -689,9 +689,11 @@ Y.ScrollView = Y.extend(ScrollView, Y.Widget, {
_onGestureMoveEnd: function (e) {
var sv = this,
gesture = sv._gesture,
+ gestureAxis = gesture.axis,
flick = gesture.flick,
clientX = e.clientX,
- clientY = e.clientY;
+ clientY = e.clientY,
+ isOOB, paginatorAxis, sameAxis;
if (sv._prevent.end) {
e.preventDefault();
@@ -713,17 +715,27 @@ Y.ScrollView = Y.extend(ScrollView, Y.Widget, {
// If there was movement (_onGestureMove fired)
if (gesture.deltaX !== null && gesture.deltaY !== null) {
-
+
+ isOOB = sv._isOutOfBounds();
+
// If we're out-out-bounds, then snapback
- if (sv._isOutOfBounds()) {
+ if (isOOB) {
sv._snapBack();
}
// Inbounds
else {
- // Don't fire scrollEnd on the gesture axis is the same as paginator's
- // Not totally confident this is ideal to access a plugin's properties from a host, @TODO revisit
- if (sv.pages && !sv.pages.get(AXIS)[gesture.axis]) {
+ if (sv.pages) {
+ paginatorAxis = sv.pages.get(AXIS);
+ sameAxis = paginatorAxis[gestureAxis];
+
+ // Don't fire scrollEnd on the gesture axis is the same as paginator's
+ // Not totally confident this is ideal to access a plugin's properties from a host, @TODO revisit
+ if (!sameAxis) {
+ sv._onTransEnd();
+ }
+ }
+ else {
sv._onTransEnd();
}
}

0 comments on commit f847edf

Please sign in to comment.