diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js index e1fbd04a8da..1bb546f7081 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -591,10 +591,20 @@ $(document).ready(function(){ } }); - // 'show password' checkbox - $('#password').showPassword(); - $('#adminpass').showPassword(); - $('#pass2').showPassword(); + var setShowPassword = function(input, label) { + input.showPassword().keyup(function(){ + if (input.val().length == 0) { + label.hide(); + } + else { + label.css("display", "inline").show(); + } + }); + label.hide(); + }; + setShowPassword($('#password'), $('label[for=show]')); + setShowPassword($('#adminpass'), $('label[for=show]')); + setShowPassword($('#pass2'), $('label[for=personal-show]')); //use infield labels $("label.infield").inFieldLabels({ |