From 806800c185d714663e6f466a241a2b44d87e38c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Sat, 23 Jan 2016 15:25:16 +0200 Subject: [PATCH] Don't detach password field if it is not hidden (e.g. when the form says "Wrong Password") --- static/js/login.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/login.js b/static/js/login.js index 8143d276..2f115160 100644 --- a/static/js/login.js +++ b/static/js/login.js @@ -1,6 +1,10 @@ $(function () { var passwordInput = $("#password-block input"); - passwordInput.detach(); + + if ($("#password-block").hasClass("hide")) { + passwordInput.detach(); + } + $("#password-toggle").click(function() { $("#password-toggle").hide(); $("#password-block").removeClass("hide");