mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
Allow multi-touch gestures to cancel long press detection.
This commit is contained in:
@@ -383,15 +383,11 @@ var GuacamoleUI = {
|
|||||||
// Stop detection if touch moves significantly
|
// Stop detection if touch moves significantly
|
||||||
GuacamoleUI.display.addEventListener('touchmove', function(e) {
|
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 touch distance from start exceeds threshold, cancel long press
|
if (Math.abs(touch.screenX - long_press_start_x) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD
|
||||||
var touch = e.touches[0];
|
|| Math.abs(touch.screenY - long_press_start_y) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD)
|
||||||
if (Math.abs(touch.screenX - long_press_start_x) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD
|
GuacamoleUI.stopLongPressDetect();
|
||||||
|| Math.abs(touch.screenY - long_press_start_y) >= GuacamoleUI.LONG_PRESS_MOVEMENT_THRESHOLD)
|
|
||||||
GuacamoleUI.stopLongPressDetect();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user