summaryrefslogtreecommitdiffstats
path: root/src/main/resources/controllers/locationFieldController.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/controllers/locationFieldController.js')
-rw-r--r--src/main/resources/controllers/locationFieldController.js15
1 files changed, 12 insertions, 3 deletions
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