From 81872f571824a7420b2278982f3eff600ad6a730 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 27 Apr 2019 16:56:47 -0700 Subject: [PATCH] GUACAMOLE-742: Fade in overall login UI, not just login dialog. Placing the fade animation on the login dialog (which also handles the error shake-head animation) results in the dialog fading in each time the login process changes state. It really should only fade when the overall login interface initially appears. --- .../src/main/webapp/app/login/directives/login.js | 11 +++++++++-- guacamole/src/main/webapp/app/login/styles/dialog.css | 10 ++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/guacamole/src/main/webapp/app/login/directives/login.js b/guacamole/src/main/webapp/app/login/directives/login.js index e3a553c61..aad7020b9 100644 --- a/guacamole/src/main/webapp/app/login/directives/login.js +++ b/guacamole/src/main/webapp/app/login/directives/login.js @@ -66,6 +66,7 @@ angular.module('login').directive('guacLogin', [function guacLogin() { var Field = $injector.get('Field'); // Required services + var $rootScope = $injector.get('$rootScope'); var $route = $injector.get('$route'); var authenticationService = $injector.get('authenticationService'); var requestService = $injector.get('requestService'); @@ -160,9 +161,9 @@ angular.module('login').directive('guacLogin', [function guacLogin() { // Attempt login once existing session is destroyed authenticationService.authenticate($scope.enteredValues) - // Clear and reload upon success + // Retry route upon success (entered values will be cleared only + // after route change has succeeded as this can take time) .then(function loginSuccessful() { - $scope.enteredValues = {}; $route.reload(); }) @@ -199,6 +200,12 @@ angular.module('login').directive('guacLogin', [function guacLogin() { }; + // Reset state after authentication and routing have succeeded + $rootScope.$on('$routeChangeSuccess', function routeChanged() { + $scope.enteredValues = {}; + $scope.submitted = false; + }); + }]; return directive; diff --git a/guacamole/src/main/webapp/app/login/styles/dialog.css b/guacamole/src/main/webapp/app/login/styles/dialog.css index c9c6a4af6..998ce133f 100644 --- a/guacamole/src/main/webapp/app/login/styles/dialog.css +++ b/guacamole/src/main/webapp/app/login/styles/dialog.css @@ -26,6 +26,12 @@ -webkit-animation-timing-function: linear; } +.login-ui { + animation: fadein 0.125s linear; + -moz-animation: fadein 0.125s linear; + -webkit-animation: fadein 0.125s linear; +} + .login-ui div.login-dialog-middle { width: 100%; display: table-cell; @@ -35,10 +41,6 @@ .login-ui div.login-dialog { - animation: fadein 0.125s linear; - -moz-animation: fadein 0.125s linear; - -webkit-animation: fadein 0.125s linear; - width: 100%; max-width: 3in; text-align: left;