From cefe2f3e190f2a31bb9cb81e4a87942a9faea9fd Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 21 Apr 2014 10:34:34 -0700 Subject: [PATCH] GUAC-324: Implement menu scroll. --- guacamole/src/main/webapp/scripts/client-ui.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js index b9a71e8c2..9cca23a73 100644 --- a/guacamole/src/main/webapp/scripts/client-ui.js +++ b/guacamole/src/main/webapp/scripts/client-ui.js @@ -813,8 +813,11 @@ GuacUI.Client.updateTitle = function () { GuacUI.Client.showMenu = function(shown) { if (shown === false) GuacUI.Client.menu.className = "closed"; - else + else { + GuacUI.Client.menu.scrollLeft = 0; + GuacUI.Client.menu.scrollTop = 0; GuacUI.Client.menu.className = "open"; + } }; /** @@ -1547,10 +1550,15 @@ GuacUI.Client.attach = function(guac) { // Hide menu if swiping left else if (GuacUI.Client.isMenuShown()) { + + GuacUI.Client.menu.scrollLeft -= change_drag_dx; + GuacUI.Client.menu.scrollTop -= change_drag_dy; + if (dx <= -64 && Math.abs(dy) < 32 && duration < 250) { GuacUI.Client.showMenu(false); guac_drag.cancel(); } + } // Otherwise, drag UI