From 6a5e3d9791f7218e0073e730546e0a79b4cdfc6d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 21 Dec 2014 02:30:32 -0800 Subject: [PATCH] GUAC-901: Clamp scrollTop/scrollLeft to real values. --- .../main/webapp/app/client/directives/guacClient.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/guacamole/src/main/webapp/app/client/directives/guacClient.js b/guacamole/src/main/webapp/app/client/directives/guacClient.js index 498fd5ac0..1ef3bcdec 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacClient.js +++ b/guacamole/src/main/webapp/app/client/directives/guacClient.js @@ -322,12 +322,14 @@ angular.module('client').directive('guacClient', [function guacClient() { * SCROLLING */ - $scope.$watch('clientProperties.scrollLeft', function scrollLeftChanged(newValue, oldValue) { - main.scrollLeft += newValue - oldValue; + $scope.$watch('clientProperties.scrollLeft', function scrollLeftChanged(scrollLeft) { + main.scrollLeft = scrollLeft; + $scope.clientProperties.scrollLeft = main.scrollLeft; }); - $scope.$watch('clientProperties.scrollTop', function scrollTopChanged(newValue, oldValue) { - main.scrollTop += newValue - oldValue; + $scope.$watch('clientProperties.scrollTop', function scrollTopChanged(scrollTop) { + main.scrollTop = scrollTop; + $scope.clientProperties.scrollTop = main.scrollTop; }); /*