diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-01-18 13:45:39 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-01-18 13:45:39 +0100 |
commit | 805f900b1980ae1f5d69395fd646a9a4605b7c68 (patch) | |
tree | 194e43ad1f9b23fa9546cbcd8a0592dd9cbbd951 /apps/user_ldap/js | |
parent | 229d4842001d6857dee2e32ff2e9768dc4143bcb (diff) | |
download | nextcloud-server-805f900b1980ae1f5d69395fd646a9a4605b7c68.tar.gz nextcloud-server-805f900b1980ae1f5d69395fd646a9a4605b7c68.zip |
LDAP: pass defaults to settings form, and restore them on creating a new configuration if wanted
Diffstat (limited to 'apps/user_ldap/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'); + } + }); } } ); |