summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/js/js.js b/core/js/js.js
index b237c6fcf5b..93d4c0a03e5 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -638,9 +638,21 @@ $(document).ready(function(){
});
// 'show password' checkbox
- $('#password').showPassword();
- $('#adminpass').showPassword();
- $('#pass2').showPassword();
+
+ var hideToggleBtn = function(input, label) {
+ // 'show password' checkbox
+ input.showPassword().keyup(function(){
+ if (input.val().length == 0) {
+ label.hide();
+ } else {
+ label.css("display", "inline").show();
+ }
+ });
+ label.hide();
+ };
+ hideToggleBtn($('#password'), $('label[for=show]'));
+ hideToggleBtn($('#adminpass'), $('label[for=show]'));
+ hideToggleBtn($('#pass2'), $('label[for=personal-show]'));
//use infield labels
$("label.infield").inFieldLabels({