diff --git a/UI/Templates/MainUI/SOGoRootPage.wox b/UI/Templates/MainUI/SOGoRootPage.wox index 0930be948..8570a8c53 100644 --- a/UI/Templates/MainUI/SOGoRootPage.wox +++ b/UI/Templates/MainUI/SOGoRootPage.wox @@ -61,8 +61,8 @@ vpn_key - - visibility + + visibility @@ -221,17 +221,20 @@ - + + visibility - + + visibility - + + visibility
diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 3d84c554a..f0f822f51 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -326,12 +326,14 @@ - + + visibility - + + visibility
    @@ -343,7 +345,8 @@ - + + visibility
    diff --git a/UI/WebServerResources/js/Main/Main.app.js b/UI/WebServerResources/js/Main/Main.app.js index 9f0fcf59d..eda808234 100644 --- a/UI/WebServerResources/js/Main/Main.app.js +++ b/UI/WebServerResources/js/Main/Main.app.js @@ -29,7 +29,8 @@ this.verificationCodePattern = '\\d{6}'; // Password policy - change expired password - this.passwords = { newPassword: null, newPasswordConfirmation: null, oldPassword: null, visible: false }; + this.passwords = { newPassword: null, newPasswordConfirmation: null, oldPassword: null }; + this.passwordsDisplayed = { password: false, oldPassword: false, newPassword: false, newPasswordConfirmation: false }; // Password recovery this.passwordRecovery = { @@ -330,17 +331,17 @@ } }; - this.changePasswordVisibility = function () { - this.passwords.visible = !this.passwords.visible; - var field = document.getElementById("passwordField"); - if (this.passwords.visible) { + 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("password-visibility-icon").innerHTML = 'visibility_off'; + document.getElementById(iconId).innerHTML = 'visibility_off'; } else { field.type = "password"; - document.getElementById("password-visibility-icon").innerHTML = 'visibility'; + document.getElementById(iconId).innerHTML = 'visibility'; } - } + }; } angular diff --git a/UI/WebServerResources/js/Preferences/PreferencesController.js b/UI/WebServerResources/js/Preferences/PreferencesController.js index c92537bb1..ddbb03880 100644 --- a/UI/WebServerResources/js/Preferences/PreferencesController.js +++ b/UI/WebServerResources/js/Preferences/PreferencesController.js @@ -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