mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
3
js/angular/controller/slideBoxController.js
vendored
3
js/angular/controller/slideBoxController.js
vendored
@@ -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);
|
||||
|
||||
2
js/angular/service/attachDrag.js
vendored
2
js/angular/service/attachDrag.js
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user