diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-02 17:41:04 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-02 17:41:04 +0100 |
| commit | fa5a48bc3a76b109f6611620b6e56f3024def029 (patch) | |
| tree | 5dc6f12f28c2ecff2aa46d37272ce190258e1935 /client/js | |
| parent | b6d7d2c30efe5e9758072bb82ea3a947bda7fd1d (diff) | |
Correct bugs
Diffstat (limited to 'client/js')
| -rw-r--r-- | client/js/controllers/login.js | 3 | ||||
| -rw-r--r-- | client/js/controllers/status.js | 6 | ||||
| -rw-r--r-- | client/js/services/Identity.js | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js index 1a89563..63cb6d1 100644 --- a/client/js/controllers/login.js +++ b/client/js/controllers/login.js @@ -16,10 +16,11 @@ mainApp.controller('loginCtrl', ['$scope','$sce','Identity', function ($scope,$s // Manager logout event $scope.$on('logoutEvent', function(){ - Identity.logout(); $('#loginModal').modal({backdrop: 'static', keyboard: false}); }); + + // Hide loading button and message alert $('#loadingLoginButton').hide(); $('#failedToLoginAlert').hide(); diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js index 940d794..6f398ad 100644 --- a/client/js/controllers/status.js +++ b/client/js/controllers/status.js @@ -11,10 +11,10 @@ mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($ // Give profile to model $scope.profile=Identity.getProfile(); - + // Function to logout - $scope.raiseLogoutEvent=function(){ - $rootScope.$broadcast('logoutEvent'); + $scope.logout=function(){ + Identity.logout(); }; }]); diff --git a/client/js/services/Identity.js b/client/js/services/Identity.js index da85ecd..e6a9daf 100644 --- a/client/js/services/Identity.js +++ b/client/js/services/Identity.js @@ -1,5 +1,5 @@ -mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ +mainApp.factory('Identity',[ '$http', '$cookies', '$rootScope', function($http, $cookies, $rootScope){ /* Create profile structure to store informations * about current session @@ -51,6 +51,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ token=null; profile.username=null; profile.projectname=null; + + // Reload Page + location.reload(); } @@ -95,6 +98,7 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ else{ requestParserResult.failReason="Please check your username, password and project name !"; } + return requestParserResult; }; |
