From ec7505987dc83982ed5eeaef7c4cc0230bfc48aa Mon Sep 17 00:00:00 2001 From: si458 Date: Sat, 5 Oct 2024 16:59:55 +0100 Subject: [PATCH] fix login button disabled when autofilled #6428 Signed-off-by: si458 --- views/login-mobile.handlebars | 12 +++++++----- views/login.handlebars | 12 +++++++----- views/login2.handlebars | 18 ++++++++++-------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/views/login-mobile.handlebars b/views/login-mobile.handlebars index 3d8c7ba0..30940bae 100644 --- a/views/login-mobile.handlebars +++ b/views/login-mobile.handlebars @@ -574,11 +574,13 @@ } function validateLogin(box, e) { - var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0)); - QE('loginButton', ok); - setDialogMode(0); - if ((e != null) && (e.keyCode == 13)) { if (box == 1) { Q('password').focus(); } else if (box == 2) { Q('loginButton').click(); } } - if (e != null) { haltEvent(e); } + setTimeout(function(){ + var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0)); + QE('loginButton', ok); + setDialogMode(0); + if ((e != null) && (e.keyCode == 13)) { if (box == 1) { Q('password').focus(); } else if (box == 2) { Q('loginButton').click(); } } + if (e != null) { haltEvent(e); } + }, 100); } function validateCreate(box,e) { diff --git a/views/login.handlebars b/views/login.handlebars index 0b3c3f09..0ae79676 100644 --- a/views/login.handlebars +++ b/views/login.handlebars @@ -662,11 +662,13 @@ } function validateLogin(box, e) { - var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0)); - QE('loginButton', ok); - setDialogMode(0); - if ((e != null) && (e.keyCode == 13)) { if ((box == 1) && (Q('username').value != '')) { Q('password').focus(); } else if ((box == 2) && (Q('password').value != '')) { Q('loginButton').click(); } } - if (e != null) { haltEvent(e); } + setTimeout(function(){ + var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0)); + QE('loginButton', ok); + setDialogMode(0); + if ((e != null) && (e.keyCode == 13)) { if ((box == 1) && (Q('username').value != '')) { Q('password').focus(); } else if ((box == 2) && (Q('password').value != '')) { Q('loginButton').click(); } } + if (e != null) { haltEvent(e); } + }, 100); } function validateCreate(box, e) { diff --git a/views/login2.handlebars b/views/login2.handlebars index 3e6446ba..bbd78a55 100644 --- a/views/login2.handlebars +++ b/views/login2.handlebars @@ -773,14 +773,16 @@ } function validateLogin(box, e) { - var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0)); - QE('loginButton', ok); - setDialogMode(0); - if ((e != null) && (e.keyCode == 13)) { - if ((box == 1) && (Q('username').value != '')) { Q('password').focus(); } - else if ((box == 2) && (Q('password').value != '')) { Q('loginButton').click(); } - } - if (e != null) { haltEvent(e); } + setTimeout(function(){ + var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0)); + QE('loginButton', ok); + setDialogMode(0); + if ((e != null) && (e.keyCode == 13)) { + if ((box == 1) && (Q('username').value != '')) { Q('password').focus(); } + else if ((box == 2) && (Q('password').value != '')) { Q('loginButton').click(); } + } + if (e != null) { haltEvent(e); } + }, 100); } function validateCreate(box, e) {