Fixes autofill for display / hide toggle button, a better function name.

This commit is contained in:
raghunayyar 2013-03-25 16:09:35 +05:30
parent d9cd9875e0
commit 25a8690318
1 changed files with 15 additions and 14 deletions

View File

@ -637,22 +637,23 @@ $(document).ready(function(){
} }
}); });
var setShowPassword = function(input, label) {
// 'show password' checkbox // 'show password' checkbox
setTimeout(function() {
var hideToggleBtn = function(input, label) {
// 'show password' checkbox
input.showPassword().keyup(function(){ input.showPassword().keyup(function(){
if (input.val().length == 0) { if (input.val().length == 0) {
label.hide(); label.hide();
} else { }
else {
label.css("display", "inline").show(); label.css("display", "inline").show();
} }
}); });
},200);
label.hide(); label.hide();
}; };
hideToggleBtn($('#password'), $('label[for=show]')); setShowPassword($('#password'), $('label[for=show]'));
hideToggleBtn($('#adminpass'), $('label[for=show]')); setShowPassword($('#adminpass'), $('label[for=show]'));
hideToggleBtn($('#pass2'), $('label[for=personal-show]')); setShowPassword($('#pass2'), $('label[for=personal-show]'));
//use infield labels //use infield labels
$("label.infield").inFieldLabels({ $("label.infield").inFieldLabels({