diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index b613838e4..7fb586192 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -154,25 +154,41 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams callback: RECONNECT_ACTION.callback, remaining: 15 }; - - // Hide menu by default - $scope.menuShown = false; - // Use physical keyboard by default - $scope.inputMethod = 'none'; + /** + * Menu-specific properties. + */ + $scope.menu = { + + /** + * Whether the menu is currently shown. + * + * @type Boolean + */ + shown : false, + + /** + * The currently selected input method. This may be either 'none', + * 'osk', or 'none'. + * + * @type String + */ + inputMethod : 'none', + + /** + * The current scroll state of the menu. + * + * @type ScrollState + */ + scrollState : new ScrollState() + + }; // Convenience method for closing the menu $scope.closeMenu = function closeMenu() { - $scope.menuShown = false; + $scope.menu.shown = false; }; - /** - * The current scroll state of the menu. - * - * @type ScrollState - */ - $scope.menuScrollState = new ScrollState(); - // Update the model when clipboard data received from client $scope.$on('guacClientClipboard', function clientClipboardListener(event, client, mimetype, clipboardData) { $scope.clipboardData = clipboardData; @@ -206,12 +222,12 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams // Hide menu if swipe gesture is detected if (Math.abs(currentY - startY) < MENU_DRAG_VERTICAL_TOLERANCE && startX - currentX >= MENU_DRAG_DELTA) - $scope.menuShown = false; + $scope.menu.shown = false; // Scroll menu by default else { - $scope.menuScrollState.left -= deltaX; - $scope.menuScrollState.top -= deltaY; + $scope.menu.scrollState.left -= deltaX; + $scope.menu.scrollState.top -= deltaY; } return false; @@ -226,7 +242,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams if (Math.abs(currentY - startY) < MENU_DRAG_VERTICAL_TOLERANCE && currentX - startX >= MENU_DRAG_DELTA) - $scope.menuShown = true; + $scope.menu.shown = true; } @@ -307,7 +323,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams }; // Show/hide UI elements depending on input method - $scope.$watch('inputMethod', function setInputMethod(inputMethod) { + $scope.$watch('menu.inputMethod', function setInputMethod(inputMethod) { // Show input methods only if selected $scope.showOSK = (inputMethod === 'osk'); @@ -315,7 +331,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams }); - $scope.$watch('menuShown', function menuVisibilityChanged(menuShown, menuShownPreviousState) { + $scope.$watch('menu.shown', function menuVisibilityChanged(menuShown, menuShownPreviousState) { // Send clipboard data if menu is hidden if (!menuShown && menuShownPreviousState) @@ -351,7 +367,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams // Toggle the menu $scope.$apply(function() { - $scope.menuShown = !$scope.menuShown; + $scope.menu.shown = !$scope.menu.shown; }); } } @@ -372,8 +388,8 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams // Show menu and scroll file transfer into view if (count > oldCount) { - $scope.menuShown = true; - $scope.fileTransferMarker.scrollIntoView(); + $scope.menu.shown = true; + $scope.menu.fileTransferMarker.scrollIntoView(); } }); @@ -495,7 +511,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams $scope.client.client.disconnect(); // Hide menu - $scope.menuShown = false; + $scope.menu.shown = false; }; diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html index 55781ec8a..aa2d5c294 100644 --- a/guacamole/src/main/webapp/app/client/templates/client.html +++ b/guacamole/src/main/webapp/app/client/templates/client.html @@ -20,8 +20,9 @@ THE SOFTWARE. --> - + +
@@ -49,90 +50,89 @@
+ +
- - -