GUAC-605: Remove unnecessary watch on connection name.

This commit is contained in:
Michael Jumper
2014-11-14 11:54:31 -08:00
parent 4863a8e96b
commit b5ec678906

View File

@@ -23,8 +23,8 @@
/** /**
* The controller for the page used to connect to a connection or balancing group. * The controller for the page used to connect to a connection or balancing group.
*/ */
angular.module('home').controller('clientController', ['$scope', '$routeParams', 'localStorageUtility', '$injector', angular.module('home').controller('clientController', ['$scope', '$routeParams', '$injector',
function clientController($scope, $routeParams, localStorageUtility, $injector) { function clientController($scope, $routeParams, $injector) {
/* /*
* In order to open the guacamole menu, we need to hit ctrl-alt-shift. There are * In order to open the guacamole menu, we need to hit ctrl-alt-shift. There are
@@ -97,25 +97,20 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
$scope.id = $routeParams.type + '/' + $routeParams.id; $scope.id = $routeParams.type + '/' + $routeParams.id;
$scope.connectionParameters = $routeParams.params || ''; $scope.connectionParameters = $routeParams.params || '';
// Keep title in sync with connection state
$scope.$watch('connectionName', function updateTitle() {
$scope.page.title = $scope.connectionName;
});
// Pull connection name from server // Pull connection name from server
switch ($scope.type) { switch ($scope.type) {
// Connection // Connection
case 'c': case 'c':
connectionDAO.getConnection($scope.id).success(function (connection) { connectionDAO.getConnection($scope.id).success(function (connection) {
$scope.connectionName = connection.name; $scope.page.title = connection.name;
}); });
break; break;
// Connection group // Connection group
case 'g': case 'g':
connectionGroupDAO.getConnectionGroup($scope.id).success(function (group) { connectionGroupDAO.getConnectionGroup($scope.id).success(function (group) {
$scope.connectionName = group.name; $scope.page.title = group.name;
}); });
break; break;