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:
zotlabs
2017-11-06 20:13:14 -08:00
parent 11a7a08b9d
commit 3f1a4b6559
6 changed files with 377 additions and 1 deletions

32
view/js/mod_defperms.js Normal file
View 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();
});
}