From 9c04863aae859d5733ed5a28bd96a5a94a692a9f Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 10 Jan 2024 23:59:24 +0000 Subject: [PATCH] GUACAMOLE-1904: Add new events to allow children to open/close the client menu. --- .../src/app/client/controllers/clientController.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/guacamole/src/main/frontend/src/app/client/controllers/clientController.js b/guacamole/src/main/frontend/src/app/client/controllers/clientController.js index f574dd18f2..e20373e37b 100644 --- a/guacamole/src/main/frontend/src/app/client/controllers/clientController.js +++ b/guacamole/src/main/frontend/src/app/client/controllers/clientController.js @@ -468,8 +468,21 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams else if (menuShownPreviousState) $scope.applyParameterChanges($scope.focusedClient); + /* Broadcast changes to the menu display state */ + $scope.$broadcast('guacMenuShown', menuShown); + }); + // Toggle the menu when the guacClientToggleMenu event is received + $scope.$on('guacToggleMenu', + () => $scope.menu.shown = !$scope.menu.shown); + + // Show the menu when the guacClientShowMenu event is received + $scope.$on('guacShowMenu', () => $scope.menu.shown = true); + + // Hide the menu when the guacClientHideMenu event is received + $scope.$on('guacHideMenu', () => $scope.menu.shown = false); + // Broadcast any mouse events caught from clients back down to the rest // of the client page $scope.$on('guacClientMouseEvent', (angularEvent, mouseEvent) => {