second half of issue #893 - move channel default permissions to its own module so we can apply different page/widget layouts than for connedit; the relevant functionality is abandoned on mod_connedit but still intact. Trying a slightly different look/behaviour for inherited settings and the associated checkboxes. This may need a bit more tweaking but overall looks a lot cleaner.
This commit is contained in:
32
view/js/mod_defperms.js
Normal file
32
view/js/mod_defperms.js
Normal file
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user