diff --git a/dev/View/Admin/Login.js b/dev/View/Admin/Login.js index 9ad0a0034..d718f9293 100644 --- a/dev/View/Admin/Login.js +++ b/dev/View/Admin/Login.js @@ -31,19 +31,16 @@ class LoginAdminView extends AbstractViewCenter { submitError: '' }); - this.loginErrorAnimation = ko.observable(false).extend({ 'falseTimeout': 500 }); - this.passwordErrorAnimation = ko.observable(false).extend({ 'falseTimeout': 500 }); - - this.formError = ko.computed(() => this.loginErrorAnimation() || this.passwordErrorAnimation()); + this.formError = ko.observable(false).extend({ 'falseTimeout': 500 }); this.addSubscribables({ login: () => this.loginError(false), password: () => this.passwordError(false), - loginError: v => this.loginErrorAnimation(!!v), + loginError: v => this.formError(!!v), - passwordError: v => this.passwordErrorAnimation(!!v) + passwordError: v => this.formError(!!v) }); } diff --git a/dev/View/User/Login.js b/dev/View/User/Login.js index e781dee1e..0bfb7e739 100644 --- a/dev/View/User/Login.js +++ b/dev/View/User/Login.js @@ -69,16 +69,13 @@ class LoginUserView extends AbstractViewCenter { signMeType: LoginSignMeType.Unused }); - this.additionalCodeErrorAnimation = ko.observable(false).extend({ falseTimeout: 500 }); - this.mobile = !!Settings.app('mobile'); this.mobileDevice = !!Settings.app('mobileDevice'); this.forgotPasswordLinkUrl = Settings.app('forgotPasswordLinkUrl'); this.registrationLinkUrl = Settings.app('registrationLinkUrl'); - this.emailErrorAnimation = ko.observable(false).extend({ falseTimeout: 500 }); - this.passwordErrorAnimation = ko.observable(false).extend({ falseTimeout: 500 }); + this.formError = ko.observable(false).extend({ falseTimeout: 500 }); this.allowLanguagesOnLogin = !!Settings.get('AllowLanguagesOnLogin'); @@ -88,11 +85,6 @@ class LoginUserView extends AbstractViewCenter { this.bSendLanguage = false; this.addComputables({ - formError: - () => - this.emailErrorAnimation() || - this.passwordErrorAnimation() || - (this.additionalCodeVisibility() && this.additionalCodeErrorAnimation()), languageFullName: () => convertLangName(this.language()), @@ -109,12 +101,12 @@ class LoginUserView extends AbstractViewCenter { password: () => this.passwordError(false), additionalCode: () => this.additionalCodeError(false), - additionalCodeError: bV => this.additionalCodeErrorAnimation(!!bV), + additionalCodeError: bV => this.formError(!!bV), additionalCodeVisibility: () => this.additionalCodeError(false), - emailError: bV => this.emailErrorAnimation(!!bV), + emailError: bV => this.formError(!!bV), - passwordError: bV => this.passwordErrorAnimation(!!bV), + passwordError: bV => this.formError(!!bV), submitError: value => value || this.submitErrorAddidional(''), diff --git a/snappymail/v/0.0.0/app/templates/Views/Admin/AdminLogin.html b/snappymail/v/0.0.0/app/templates/Views/Admin/AdminLogin.html index fa0526818..ceebbb090 100644 --- a/snappymail/v/0.0.0/app/templates/Views/Admin/AdminLogin.html +++ b/snappymail/v/0.0.0/app/templates/Views/Admin/AdminLogin.html @@ -6,7 +6,7 @@
-
+
-
+
-
+
+ data-bind="visible: additionalCodeVisibility(), css: {'error': additionalCodeError}">