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(){
}
});
// 'show password' checkbox
var hideToggleBtn = function(input, label) {
var setShowPassword = 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();
setTimeout(function() {
input.showPassword().keyup(function(){
if (input.val().length == 0) {
label.hide();
}
else {
label.css("display", "inline").show();
}
});
},200);
label.hide();
};
hideToggleBtn($('#password'), $('label[for=show]'));
hideToggleBtn($('#adminpass'), $('label[for=show]'));
hideToggleBtn($('#pass2'), $('label[for=personal-show]'));
setShowPassword($('#password'), $('label[for=show]'));
setShowPassword($('#adminpass'), $('label[for=show]'));
setShowPassword($('#pass2'), $('label[for=personal-show]'));
//use infield labels
$("label.infield").inFieldLabels({