From bc3496663d1fffdbe70ffbfc40d9105c4672000d Mon Sep 17 00:00:00 2001 From: adhallet Date: Mon, 18 Mar 2019 13:16:47 +0100 Subject: [PATCH] Show/hide password on login page --- .../apps/authentication/static/authentication.js | 12 ++++++++++++ .../authentication/templates/authentication.html | 4 +++- code/haitiwater/static-common/stylesheets/theme.css | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 code/haitiwater/apps/authentication/static/authentication.js diff --git a/code/haitiwater/apps/authentication/static/authentication.js b/code/haitiwater/apps/authentication/static/authentication.js new file mode 100644 index 0000000..f98f472 --- /dev/null +++ b/code/haitiwater/apps/authentication/static/authentication.js @@ -0,0 +1,12 @@ +function togglePasswordVisibility(){ + let passwordField = document.getElementById('id_password'); + let toggleIcon = document.getElementById('password-visibility-toggle'); + if (passwordField.type === "password"){ + passwordField.type = "text"; + console.log(toggleIcon); + toggleIcon.classList.replace('fa-eye', 'fa-eye-slash'); + } else { + passwordField.type = "password"; + toggleIcon.classList.replace('fa-eye-slash', 'fa-eye'); + } +} \ No newline at end of file diff --git a/code/haitiwater/apps/authentication/templates/authentication.html b/code/haitiwater/apps/authentication/templates/authentication.html index 524d14f..331f42b 100644 --- a/code/haitiwater/apps/authentication/templates/authentication.html +++ b/code/haitiwater/apps/authentication/templates/authentication.html @@ -30,6 +30,8 @@ + + @@ -85,7 +87,7 @@ - + diff --git a/code/haitiwater/static-common/stylesheets/theme.css b/code/haitiwater/static-common/stylesheets/theme.css index d72a962..25dce0d 100644 --- a/code/haitiwater/static-common/stylesheets/theme.css +++ b/code/haitiwater/static-common/stylesheets/theme.css @@ -3789,6 +3789,10 @@ html.dark .form-bordered .form-group { pointer-events: none; } +.allow-pointer-events { + pointer-events: auto; +} + .input-group-icon .input-group-addon span.icon.icon-lg, .input-search .input-group-addon span.icon.icon-lg { padding: 10px 14px;