diff options
Diffstat (limited to 'apps/user_ldap/js/settings.js')
-rw-r--r-- | apps/user_ldap/js/settings.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js index 8cd31301f2e..0b8f141dfa2 100644 --- a/apps/user_ldap/js/settings.js +++ b/apps/user_ldap/js/settings.js @@ -34,8 +34,16 @@ $(document).ready(function() { 'Keep settings?', function(keep) { if(!keep) { - $('#ldap').find('input[type=text], input[type=password], textarea, select').val(''); - $('#ldap').find('input[type=checkbox]').removeAttr('checked'); + $('#ldap').find('input[type=text], input[type=number], input[type=password], textarea, select').each(function() { + $(this).val($(this).attr('data-default')); + }); + $('#ldap').find('input[type=checkbox]').each(function() { + if($(this).attr('data-default') == 1) { + $(this).attr('checked', 'checked'); + } else { + $(this).removeAttr('checked'); + } + }); } } ); |