diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-06-30 17:41:12 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-06-30 17:41:12 +0300 |
commit | 96708c65628851c784ad5829e1a673a32cfab1e6 (patch) | |
tree | eabce9b5624e21d6c1bbf52dffc6d40e86262f58 /js | |
parent | 1abff7050e307755b6c28d26fa5136669a5e57fa (diff) |
Replace tab based design with a scrollable design
Diffstat (limited to 'js')
-rw-r--r-- | js/admin.js | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/js/admin.js b/js/admin.js index d10d5bc4..0e561faa 100644 --- a/js/admin.js +++ b/js/admin.js @@ -6,7 +6,6 @@ function setSAMLConfigValue(category, setting, value) { $(function() { // Enable tabs - $('#user-saml-settings').tabs(); $('input:checkbox[value="1"]').attr('checked', true); $('#user-saml-sp input[type="text"], #user-saml-sp textarea').change(function(e) { @@ -70,4 +69,36 @@ $(function() { setSAMLConfigValue('security', key, $(this).val()); }); }); + + $('#user-saml-settings .toggle').on('click', function() { + var el = $(this), + nextSibling = el.parent().next(), + parentSettingId = el.closest('div').attr('id'), + text = ''; + switch(parentSettingId) { + case 'user-saml-security': + if (nextSibling.hasClass('hidden')) { + text = 'Hide security settings ...'; + } else { + text = 'Show security settings ...'; + } + break; + case 'user-saml-idp': + if (nextSibling.hasClass('hidden')) { + text = 'Hide optional Identity Provider settings ...'; + } else { + text = 'Show optional Identity Provider settings ...'; + } + break; + case 'user-saml-sp': + if (nextSibling.hasClass('hidden')) { + text = 'Hide Service Provider settings ...'; + } else { + text = 'Show Service Provider settings ...'; + } + break; + } + el.html(t('user_saml', text)); + nextSibling.toggleClass('hidden'); + }); }); |