chore(slideBox): make it easier to scroll vertically

Addresses #2317
This commit is contained in:
Andrew
2014-10-09 10:27:18 -06:00
parent 950d697a70
commit 9642c4a30b
2 changed files with 3 additions and 2 deletions

View File

@@ -207,8 +207,9 @@ function(scope, element, $$ionicAttachDrag, $interval) {
// Select a new slide if it's avaiable
if (self.isInRange(nextIndex)) {
var distanceRemaining = (1 - Math.abs(percent)) * slidesParent.prop('offsetWidth');
var transitionDuration = Math.min(
slidesParent.prop('offsetWidth') / (velocity),
distanceRemaining / velocity,
SLIDE_TRANSITION_DURATION
);
self.select(nextIndex, transitionDuration);

View File

@@ -45,7 +45,7 @@ IonicModule
var deltaY = dragState.startY - ev.gesture.center.pageY;
var isVertical = ev.gesture.direction === 'up' || ev.gesture.direction === 'down';
if (isVertical && Math.abs(deltaY) > Math.abs(deltaX)) {
if (isVertical && Math.abs(deltaY) > Math.abs(deltaX) * 2) {
handleDragEnd(ev);
return;
}