From 2f74f5025c1bab140a5d6b6472683390f004bd4b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 20 Dec 2014 22:57:02 -0800 Subject: [PATCH] GUAC-901: Allow client display to be scrolled via properties. --- .../webapp/app/client/directives/guacClient.js | 12 ++++++++++++ .../webapp/app/client/types/ClientProperties.js | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/guacamole/src/main/webapp/app/client/directives/guacClient.js b/guacamole/src/main/webapp/app/client/directives/guacClient.js index 8c330805a..498fd5ac0 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacClient.js +++ b/guacamole/src/main/webapp/app/client/directives/guacClient.js @@ -318,6 +318,18 @@ angular.module('client').directive('guacClient', [function guacClient() { client.setClipboard(data); }); + /* + * SCROLLING + */ + + $scope.$watch('clientProperties.scrollLeft', function scrollLeftChanged(newValue, oldValue) { + main.scrollLeft += newValue - oldValue; + }); + + $scope.$watch('clientProperties.scrollTop', function scrollTopChanged(newValue, oldValue) { + main.scrollTop += newValue - oldValue; + }); + /* * CONNECT / RECONNECT */ diff --git a/guacamole/src/main/webapp/app/client/types/ClientProperties.js b/guacamole/src/main/webapp/app/client/types/ClientProperties.js index 7c08b360e..529022cb0 100644 --- a/guacamole/src/main/webapp/app/client/types/ClientProperties.js +++ b/guacamole/src/main/webapp/app/client/types/ClientProperties.js @@ -83,6 +83,22 @@ angular.module('client').factory('ClientProperties', [function defineClientPrope */ this.emulateAbsoluteMouse = template.emulateAbsoluteMouse || true; + /** + * The relative Y coordinate of the scroll offset of the display within + * the client element. + * + * @type Number + */ + this.scrollTop = template.scrollTop || 0; + + /** + * The relative X coordinate of the scroll offset of the display within + * the client element. + * + * @type Number + */ + this.scrollLeft = template.scrollLeft || 0; + }; return ClientProperties;