Skip to content

Commit 6808095

Browse files
committed
GUACAMOLE-1904: Add new events to allow children to open/close the client menu.
1 parent 0487365 commit 6808095

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

guacamole/src/main/frontend/src/app/client/controllers/clientController.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,21 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
468468
else if (menuShownPreviousState)
469469
$scope.applyParameterChanges($scope.focusedClient);
470470

471+
/* Broadcast changes to the menu display state */
472+
$scope.$broadcast('guacMenuShown', menuShown);
473+
471474
});
472475

476+
// Toggle the menu when the guacClientToggleMenu event is received
477+
$scope.$on('guacToggleMenu',
478+
() => $scope.menu.shown = !$scope.menu.shown);
479+
480+
// Show the menu when the guacClientShowMenu event is received
481+
$scope.$on('guacShowMenu', () => $scope.menu.shown = true);
482+
483+
// Hide the menu when the guacClientHideMenu event is received
484+
$scope.$on('guacHideMenu', () => $scope.menu.shown = false);
485+
473486
// Broadcast any mouse events caught from clients back down to the rest
474487
// of the client page
475488
$scope.$on('guacClientMouseEvent', (angularEvent, mouseEvent) => {

0 commit comments

Comments
 (0)