diff options
Diffstat (limited to 'view/js/mod_defperms.js')
-rw-r--r-- | view/js/mod_defperms.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/view/js/mod_defperms.js b/view/js/mod_defperms.js new file mode 100644 index 000000000..c89142579 --- /dev/null +++ b/view/js/mod_defperms.js @@ -0,0 +1,32 @@ +$(document).ready(function() { + + $('#id_permcat').change(function() { + $('.loading-role-rotator').show(); + var permName = $('#id_permcat').val(); + loadConnectionRole(permName); + }); + + +}); + + +function loadConnectionRole(name) { + + if(! name) + name = 'default'; + + $('.defperms-edit input').each(function() { + if(! $(this).is(':disabled')) + $(this).removeAttr('checked'); + }); + + $.get('permcat/' + name, function(data) { + $(data.perms).each(function() { + if(this.value) + $('#id_perms_' + this.name).attr('checked','checked'); + }); + $('.loading-role-rotator').hide(); + }); +} + + |