Skip to content

Commit

Permalink
move showpassword to global scope
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Jul 13, 2023
1 parent 9f77ac6 commit ea46ed4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions php/public/forms.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
"use strict";

function showPassword(id) {
let passwordField = document.getElementById(id);
if (passwordField.type === "password" && passwordField.value !== "") {
passwordField.type = "text";
} else if (passwordField.type === "text" && passwordField.value === "") {
passwordField.type = "password";
}
}

(function (){
let lastError;

Expand Down Expand Up @@ -39,15 +49,6 @@
document.getElementById('overlay').classList.remove('loading');
}

function showPassword(id) {
let passwordField = document.getElementById(id);
if (passwordField.type === "password" && passwordField.value !== "") {
passwordField.type = "text";
} else if (passwordField.type === "text" && passwordField.value === "") {
passwordField.type = "password";
}
}

function initForm(form) {
function submit(event)
{
Expand Down

0 comments on commit ea46ed4

Please sign in to comment.