From 035707bd38ac7734d58f2216c18d5a8ae90b76fe Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 11 Feb 2020 14:03:06 +0100 Subject: [PATCH] Fix freeze effect after typing a wrong password in login/register --- customize.dist/loading.js | 2 +- customize.dist/login.js | 4 ++++ www/common/common-interface.js | 2 +- www/login/main.js | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/customize.dist/loading.js b/customize.dist/loading.js index e20e79438..32841f253 100644 --- a/customize.dist/loading.js +++ b/customize.dist/loading.js @@ -3,7 +3,6 @@ define([], function () { var loadingStyle = (function(){/* #cp-loading { - transition: opacity 0.75s, visibility 0s 0.75s; visibility: visible; position: fixed; z-index: 10000000; @@ -24,6 +23,7 @@ define([], function () { #cp-loading.cp-loading-hidden { opacity: 0; visibility: hidden; + transition: opacity 0.75s, visibility 0s 0.75s; } #cp-loading .cp-loading-logo { height: 300px; diff --git a/customize.dist/login.js b/customize.dist/login.js index 0bf36b7ce..824b5e173 100644 --- a/customize.dist/login.js +++ b/customize.dist/login.js @@ -458,6 +458,7 @@ define([ UI.removeLoadingScreen(function () { UI.alert(Messages.login_noSuchUser, function () { hashing = false; + $('#password').focus(); }); }); break; @@ -465,6 +466,7 @@ define([ UI.removeLoadingScreen(function () { UI.alert(Messages.login_invalUser, function () { hashing = false; + $('#password').focus(); }); }); break; @@ -472,6 +474,7 @@ define([ UI.removeLoadingScreen(function () { UI.alert(Messages.login_invalPass, function () { hashing = false; + $('#password').focus(); }); }); break; @@ -482,6 +485,7 @@ define([ ]); UI.alert(warning, function () { hashing = false; + $('#password').focus(); }); }); break; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index b9869ba67..14b06527f 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -484,7 +484,7 @@ define([ stopListening(listener); cb(); }); - listener = listenForKeys(close, close); + listener = listenForKeys(close, close, frame); var $ok = $(ok).click(close); document.body.appendChild(frame); diff --git a/www/login/main.js b/www/login/main.js index 229225ea8..40a82b27e 100644 --- a/www/login/main.js +++ b/www/login/main.js @@ -48,7 +48,7 @@ define([ var $passwd = $('#password') // background loading of login assets // enter key while on password field clicks signup - .on('keyup', function (e) { + .on('keydown', function (e) { if (e.which !== 13) { return; } // enter $('button.login').click(); });