From 97ea2c057300df35195124dd00dbbd6739d46c38 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 22 Mar 2012 17:28:17 -0700 Subject: [PATCH] Use screenX/screenY for touch. --- src/main/webapp/scripts/interface.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/scripts/interface.js b/src/main/webapp/scripts/interface.js index 5eac5c0..be79b38 100644 --- a/src/main/webapp/scripts/interface.js +++ b/src/main/webapp/scripts/interface.js @@ -365,8 +365,8 @@ var GuacamoleUI = { // Record touch location if (e.touches.length == 1) { var touch = e.touches[0]; - long_press_start_x = touch.pageX; - long_press_start_y = touch.pageY; + long_press_start_x = touch.screenX; + long_press_start_y = touch.screenY; } // Start detection @@ -381,8 +381,8 @@ var GuacamoleUI = { // If touch distance from start exceeds threshold, cancel long press var touch = e.touches[0]; - if (Math.abs(touch.pageX - long_press_start_x) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD - || Math.abs(touch.pageY - long_press_start_y) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD) + 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(); } -- 1.7.10.4