From 3f1a4b655900d64ad2c13f1906eb77eaf15d11b5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 6 Nov 2017 20:13:14 -0800 Subject: 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. --- view/js/mod_defperms.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 view/js/mod_defperms.js (limited to 'view/js/mod_defperms.js') 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(); + }); +} + + -- cgit v1.2.3