style(slideBox): stop scroll once horizontal dragging is active

This commit is contained in:
Andrew
2014-12-01 14:43:53 -07:00
parent 0981ba9775
commit de4ffa39f9

View File

@@ -25,8 +25,12 @@ IonicModule
ionic.offGesture(dragEndGesture, 'dragend', handleDragEnd);
});
var isDragging = false;
element.on('touchmove pointermove mousemove', function(ev) {
if (dragState && dragState.dragging) ev.preventDefault();
if (isDragging) ev.preventDefault();
});
element.on('touchend mouseup mouseleave', function(ev) {
isDragging = false;
});
var dragState;
@@ -50,7 +54,7 @@ IonicModule
handleDragEnd(ev);
return;
}
dragState.dragging = true;
isDragging = true;
var percent = getDragPercent(ev.gesture.center.pageX);
opts.onDrag(percent);