aboutsummaryrefslogblamecommitdiffstats
path: root/view/js/mod_defperms.js
blob: c89142579e0ac289eb0c3daa814ddeee0d562ad6 (plain) (tree)































                                                                                      
$(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();
	});
}