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 3517f2d5f2..6a486fe9a2 100644 --- a/guacamole/src/main/frontend/src/app/client/controllers/clientController.js +++ b/guacamole/src/main/frontend/src/app/client/controllers/clientController.js @@ -498,20 +498,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams $scope.menu.connectionParameters = newFocusedClient ? ManagedClient.getArgumentModel(newFocusedClient) : {}; - // Re-broadcast the updated client - $scope.$broadcast('guacClientChanged', newFocusedClient); - - }); - - // Track when the protocol changes for the current client - generally - // this will be when the protocol is first set for the client - $scope.$on('guacClientProtocolUpdated', function protocolChanged(event, focusedClient) { - - // Ignore any updated protocol not for the current focused client - if ($scope.focusedClient && $scope.focusedClient === focusedClient) - - // Re-broadcast the updated protocol - $scope.$broadcast('guacClientProtocolChanged', focusedClient); }); // Automatically update connection parameters that have been modified @@ -519,13 +505,9 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams $scope.$on('guacClientArgumentsUpdated', function argumentsChanged(event, focusedClient) { // Ignore any updated arguments not for the current focused client - if ($scope.focusedClient && $scope.focusedClient === focusedClient) { + if ($scope.focusedClient && $scope.focusedClient === focusedClient) $scope.menu.connectionParameters = ManagedClient.getArgumentModel(focusedClient); - // Re-broadcast the updated arguments - $scope.$broadcast('guacClientArgumentsChanged', focusedClient); - } - }); // Update page icon when thumbnail changes diff --git a/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js b/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js index 3aa60ac74b..52289bcd0a 100644 --- a/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js +++ b/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js @@ -62,6 +62,9 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient directive.controller = ['$scope', '$injector', '$element', function guacTiledClientsController($scope, $injector, $element) { + // Required services + const $rootScope = $injector.get('$rootScope'); + // Required types const ManagedClient = $injector.get('ManagedClient'); const ManagedClientGroup = $injector.get('ManagedClientGroup'); @@ -89,17 +92,17 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient // Notify whenever identify of currently-focused client changes $scope.$watch('getFocusedClient()', function focusedClientChanged(focusedClient) { - $scope.$emit('guacClientFocused', focusedClient); + $rootScope.$broadcast('guacClientFocused', focusedClient); }); // Notify whenever arguments of currently-focused client changes $scope.$watch('getFocusedClient().arguments', function focusedClientParametersChanged() { - $scope.$emit('guacClientArgumentsUpdated', $scope.getFocusedClient()); + $rootScope.$broadcast('guacClientArgumentsUpdated', $scope.getFocusedClient()); }, true); // Notify whenever protocol of currently-focused client changes $scope.$watch('getFocusedClient().protocol', function focusedClientParametersChanged() { - $scope.$emit('guacClientProtocolUpdated', $scope.getFocusedClient()); + $rootScope.$broadcast('guacClientProtocolUpdated', $scope.getFocusedClient()); }, true); /**