fix hammer_gestures infinite loop

This commit is contained in:
asukaleido 2016-02-23 18:50:09 +09:00 committed by Vikram Subramanian
parent 2c7c3e3c69
commit 41e38e4330
1 changed files with 3 additions and 3 deletions

View File

@ -24,9 +24,9 @@ export class HammerGesturesPlugin extends HammerGesturesPluginCommon {
var mc = new Hammer(element);
mc.get('pinch').set({enable: true});
mc.get('rotate').set({enable: true});
var handler = function(eventObj) { zone.run(function() { handler(eventObj); }); };
mc.on(eventName, handler);
return () => { mc.off(eventName, handler); };
var callback = function(eventObj) { zone.run(function() { handler(eventObj); }); };
mc.on(eventName, callback);
return () => { mc.off(eventName, callback); };
});
}
}