From de4ffa39f98142d048a50dbe1169bd5f07657206 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 1 Dec 2014 14:43:53 -0700 Subject: [PATCH] style(slideBox): stop scroll once horizontal dragging is active --- js/angular/service/attachDrag.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/angular/service/attachDrag.js b/js/angular/service/attachDrag.js index 187c91d296..f1350d40bb 100644 --- a/js/angular/service/attachDrag.js +++ b/js/angular/service/attachDrag.js @@ -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);