From: Michael Jumper Date: Sun, 8 Apr 2012 21:43:42 +0000 (-0700) Subject: Stop long press detection when scrolling. X-Git-Url: http://git.alex.org.uk Stop long press detection when scrolling. --- diff --git a/src/main/webapp/scripts/interface.js b/src/main/webapp/scripts/interface.js index 092bcb8..1f5e7a5 100644 --- a/src/main/webapp/scripts/interface.js +++ b/src/main/webapp/scripts/interface.js @@ -477,16 +477,24 @@ GuacamoleUI.attach = function(guac) { var view_height = GuacamoleUI.viewport.offsetHeight; // Scroll horizontally if necessary - if (mouse_view_x > view_width) + if (mouse_view_x > view_width) { GuacamoleUI.viewport.scrollLeft += mouse_view_x - view_width; - else if (mouse_view_x < 0) + GuacamoleUI.stopLongPressDetect(); + } + else if (mouse_view_x < 0) { GuacamoleUI.viewport.scrollLeft += mouse_view_x; + GuacamoleUI.stopLongPressDetect(); + } // Scroll vertically if necessary - if (mouse_view_y > view_height) + if (mouse_view_y > view_height) { GuacamoleUI.viewport.scrollTop += mouse_view_y - view_height; - else if (mouse_view_y < 0) + GuacamoleUI.stopLongPressDetect(); + } + else if (mouse_view_y < 0) { GuacamoleUI.viewport.scrollTop += mouse_view_y; + GuacamoleUI.stopLongPressDetect(); + } // Send mouse event guac.sendMouseState(mouseState);