Allow multi-touch gestures to cancel long press detection.

This commit is contained in:
Michael Jumper
2012-03-30 23:15:53 -07:00
parent d891b90f67
commit d31a137940

View File

@@ -383,16 +383,12 @@ var GuacamoleUI = {
// Stop detection if touch moves significantly
GuacamoleUI.display.addEventListener('touchmove', function(e) {
if (e.touches.length == 1) {
// If touch distance from start exceeds threshold, cancel long press
var touch = e.touches[0];
if (Math.abs(touch.screenX - long_press_start_x) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD
|| Math.abs(touch.screenY - long_press_start_y) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD)
GuacamoleUI.stopLongPressDetect();
}
}, true);
// Stop detection if press stops