From e86d40532fa4aa08c40266496d37dc517262be40 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 30 Mar 2012 23:15:53 -0700 Subject: [PATCH] Allow multi-touch gestures to cancel long press detection. --- src/main/webapp/scripts/interface.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/scripts/interface.js b/src/main/webapp/scripts/interface.js index 9002e7e..e7ad4c3 100644 --- a/src/main/webapp/scripts/interface.js +++ b/src/main/webapp/scripts/interface.js @@ -383,15 +383,11 @@ 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(); - - } + // 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); -- 1.7.10.4