From 62b83a7a18e1878cf8192d80f02c10dffc0478d7 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Sat, 9 May 2020 01:41:41 +0200 Subject: Fix connecting to a new client after exiting a client. Add logo, favicon and logout button. --- src/main/resources/controllers/locationFieldController.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/main/resources/controllers/locationFieldController.js') diff --git a/src/main/resources/controllers/locationFieldController.js b/src/main/resources/controllers/locationFieldController.js index 8117ed7..af2b6fe 100644 --- a/src/main/resources/controllers/locationFieldController.js +++ b/src/main/resources/controllers/locationFieldController.js @@ -1,9 +1,12 @@ -angular.module('location').controller('locationFieldController', ['$scope', '$window', - function locationFieldController($scope, $window) { +angular.module('location').controller('locationFieldController', ['$scope', function locationFieldController($scope) { - $scope.data = { id: 0, password: '' } + $scope.data = { id: 0, password: '' }; $scope.$watch('data', function(newValue) { + if (window.location.hash !== '#/') { + window.location.hash = '#/'; + window.location.reload(); + } $scope.model = JSON.stringify(newValue); }, true); @@ -20,4 +23,10 @@ angular.module('location').controller('locationFieldController', ['$scope', '$wi angular.element($event.currentTarget).addClass('selected-location'); }; + $scope.logout = function logout() { + window.localStorage.removeItem('GUAC_AUTH'); + window.location.hash = '#/'; + window.location.reload(); + } + }]); \ No newline at end of file -- cgit v1.2.3-55-g7522