inputAddon.appendChild(button);
const icon = document.createElement("span");
- icon.classList.add("icon", "icon16", "fa-eye-slash");
+ icon.classList.add("icon", "icon16", "fa-eye");
button.appendChild(icon);
button.addEventListener("click", () => {
function toggle(input: HTMLInputElement, button: HTMLElement, icon: HTMLElement): void {
if (input.type === "password") {
- icon.classList.add("fa-eye");
- icon.classList.remove("fa-eye-slash");
+ icon.classList.remove("fa-eye");
+ icon.classList.add("fa-eye-slash");
button.dataset.tooltip = Language.get("wcf.global.form.password.button.hide");
input.type = "text";
} else {
- icon.classList.remove("fa-eye");
- icon.classList.add("fa-eye-slash");
+ icon.classList.add("fa-eye");
+ icon.classList.remove("fa-eye-slash");
button.dataset.tooltip = Language.get("wcf.global.form.password.button.show");
input.type = "password";
}
button.setAttribute("aria-hidden", "true");
inputAddon.appendChild(button);
const icon = document.createElement("span");
- icon.classList.add("icon", "icon16", "fa-eye-slash");
+ icon.classList.add("icon", "icon16", "fa-eye");
button.appendChild(icon);
button.addEventListener("click", () => {
toggle(input, button, icon);
}
function toggle(input, button, icon) {
if (input.type === "password") {
- icon.classList.add("fa-eye");
- icon.classList.remove("fa-eye-slash");
+ icon.classList.remove("fa-eye");
+ icon.classList.add("fa-eye-slash");
button.dataset.tooltip = Language.get("wcf.global.form.password.button.hide");
input.type = "text";
}
else {
- icon.classList.remove("fa-eye");
- icon.classList.add("fa-eye-slash");
+ icon.classList.add("fa-eye");
+ icon.classList.remove("fa-eye-slash");
button.dataset.tooltip = Language.get("wcf.global.form.password.button.show");
input.type = "password";
}