diff --git a/src/UI/UIWindowLogin.js b/src/UI/UIWindowLogin.js
index 58ab4ed2..c7937884 100644
--- a/src/UI/UIWindowLogin.js
+++ b/src/UI/UIWindowLogin.js
@@ -26,6 +26,7 @@ async function UIWindowLogin(options){
options.reload_on_success = options.reload_on_success ?? false;
options.has_head = options.has_head ?? true;
options.send_confirmation_code = options.send_confirmation_code ?? false;
+ options.show_password = options.show_password ?? false;
return new Promise(async (resolve) => {
const internal_id = window.uuidv4();
@@ -45,10 +46,14 @@ async function UIWindowLogin(options){
h += ``;
h += ``;
h += ``;
- // password
- h += `
`;
- h += `
`;
- h += `
`;
+ // password with conditional type based based on options.show_password
+ h += `
`;
+ h += `
`;
+ h += `
`;
+ // show/hide icon
+ h += `
+
+ `;
h += `
`;
// login
h += `
`;
@@ -183,6 +188,14 @@ async function UIWindowLogin(options){
if(signup)
resolve(true);
})
+
+ $(el_window).find(`#toggle-show-password-${internal_id}`).on("click", function (e) {
+ options.show_password = !options.show_password;
+ // hide/show password and update icon
+ $(el_window).find(".password").attr("type", options.show_password ? "text" : "password");
+ $(el_window).find(".toggle-show-password-icon").attr("src", options.show_password ? window.icons["eye-closed.svg"] : window.icons["eye-open.svg"],
+ )
+ })
})
}
diff --git a/src/UI/UIWindowSignup.js b/src/UI/UIWindowSignup.js
index c8a615d1..5c0e25c4 100644
--- a/src/UI/UIWindowSignup.js
+++ b/src/UI/UIWindowSignup.js
@@ -125,6 +125,7 @@ function UIWindowSignup(options){
window_options: options.window_options,
show_close_button: options.show_close_button,
send_confirmation_code: options.send_confirmation_code,
+ show_password: false,
});
if(login)
resolve(true);
diff --git a/src/icons/eye-closed.svg b/src/icons/eye-closed.svg
new file mode 100644
index 00000000..645e1735
--- /dev/null
+++ b/src/icons/eye-closed.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/eye-open.svg b/src/icons/eye-open.svg
new file mode 100644
index 00000000..2a2d14ac
--- /dev/null
+++ b/src/icons/eye-open.svg
@@ -0,0 +1 @@
+
\ No newline at end of file