feat(preferences): Add password visible icons on password change (preferences + login page)

This commit is contained in:
smizrahi
2024-02-13 11:21:26 +01:00
parent fc778295ff
commit 39640ff323
4 changed files with 36 additions and 16 deletions
@@ -14,6 +14,7 @@
this.$onInit = function() {
this.preferences = Preferences;
this.passwords = { newPassword: null, newPasswordConfirmation: null, oldPassword: null };
this.passwordsDisplayed = { oldPassword: false, newPassword: false, newPasswordConfirmation: false};
this.timeZonesList = $window.timeZonesList;
this.timeZonesSearchText = '';
this.addressesSearchText = '';
@@ -745,6 +746,18 @@
return null;
};
this.changePasswordVisibility = function (fieldId, iconId) {
this.passwordsDisplayed[fieldId] = !this.passwordsDisplayed[fieldId];
var field = document.getElementById(fieldId);
if (this.passwordsDisplayed[fieldId]) {
field.type = "text";
document.getElementById(iconId).innerHTML = 'visibility_off';
} else {
field.type = "password";
document.getElementById(iconId).innerHTML = 'visibility';
}
};
}
angular