Skip to content

Commit

Permalink
fix(gestures): improve drag/swipe response
Browse files Browse the repository at this point in the history
Fixes #1729, #2674
  • Loading branch information
adamdbradley committed Feb 10, 2015
1 parent 9dbef80 commit a5881ea
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/utils/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@
defaults: {
// set 0 for unlimited, but this can conflict with transform
swipe_max_touches : 1,
swipe_velocity : 0.7
swipe_velocity : 0.4
},
handler: function swipeGesture(ev, inst) {
if(ev.eventType == ionic.Gestures.EVENT_END) {
Expand Down Expand Up @@ -1164,6 +1164,15 @@
},
triggered: false,
handler: function dragGesture(ev, inst) {

if (ev.srcEvent.type == 'touchstart' || ev.srcEvent.type == 'touchend') {
this.preventedFirstMove = false;

} else if (!this.preventedFirstMove && ev.srcEvent.type == 'touchmove') {
ev.srcEvent.preventDefault();
this.preventedFirstMove = true;
}

// current gesture isnt drag, but dragged is true
// this means an other gesture is busy. now call dragend
if(ionic.Gestures.detection.current.name != this.name && this.triggered) {
Expand Down

0 comments on commit a5881ea

Please sign in to comment.