Skip to content

Commit

Permalink
fix(gestures): remove drag event from config
Browse files Browse the repository at this point in the history
Removes the `drag` event from the gesture config.

Fixes angular#1025.
  • Loading branch information
crisbeto committed Nov 5, 2016
1 parent a0d85d8 commit 04fb5b7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib/core/gestures/MdGestureConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export class MdGestureConfig extends HammerGestureConfig {

/* List of new event names to add to the gesture support list */
events: string[] = [
'drag',
'dragright',
'dragleft',
'longpress',
'slide',
'slidestart',
Expand Down Expand Up @@ -41,14 +38,13 @@ export class MdGestureConfig extends HammerGestureConfig {
// Notice that a HammerJS recognizer can only depend on one other recognizer once.
// Otherwise the previous `recognizeWith` will be dropped.
let slide = this._createRecognizer(pan, {event: 'slide', threshold: 0}, swipe);
let drag = this._createRecognizer(slide, {event: 'drag', threshold: 6}, swipe);
let longpress = this._createRecognizer(press, {event: 'longpress', time: 500});

// Overwrite the default `pan` event to use the swipe event.
pan.recognizeWith(swipe);

// Add customized gestures to Hammer manager
mc.add([swipe, press, pan, drag, slide, longpress]);
mc.add([swipe, press, pan, slide, longpress]);

return mc;
}
Expand All @@ -58,7 +54,7 @@ export class MdGestureConfig extends HammerGestureConfig {
let recognizer = new (<RecognizerStatic> base.constructor)(options);

inheritances.push(base);
inheritances.forEach((item) => recognizer.recognizeWith(item));
inheritances.forEach(item => recognizer.recognizeWith(item));

return recognizer;
}
Expand Down

0 comments on commit 04fb5b7

Please sign in to comment.