mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
style(slideBox): stop scroll once horizontal dragging is active
This commit is contained in:
8
js/angular/service/attachDrag.js
vendored
8
js/angular/service/attachDrag.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user