From 30cf56bdb505ffa50bb7416ec8623fb97418d358 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 20 Mar 2016 01:45:56 +0100 Subject: make >>indicate group members<< in acl selector work again on group > show or group > dont show is selected --- view/js/acl.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'view/js') diff --git a/view/js/acl.js b/view/js/acl.js index 6d94b4987..70440b572 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -231,14 +231,15 @@ ACL.prototype.update_view = function() { } $(that.group_uids[id]).each(function(i, v) { if(uclass == "grouphide") - $("#c"+v).removeClass("groupshow"); + // we need attr selection here because the id can include an @ (diaspora/friendica xchans) + $('[id="c' + v + '"]').removeClass("groupshow"); if(uclass !== "") { - var cls = $("#c"+v).attr('class'); + var cls = $('[id="c' + v + '"]').attr('class'); if( cls === undefined) return true; var hiding = cls.indexOf('grouphide'); if(hiding == -1) - $("#c"+v).addClass(uclass); + $('[id="c' + v + '"]').addClass(uclass); } }); break; @@ -277,7 +278,7 @@ ACL.prototype.populate = function(data) { $(data.items).each(function(){ html = "
"+that.item_tpl+"
"; html = html.format(this.photo, this.name, this.type, this.xid, '', this.self, this.link, this.taggable); - if (this.uids !== undefined) that.group_uids[this.id] = this.uids; + if (this.uids !== undefined) that.group_uids[this.xid] = this.uids; //console.log(html); that.list_content.append(html); }); @@ -287,4 +288,4 @@ ACL.prototype.populate = function(data) { $(el).removeAttr("data-src"); }); that.update_view(); -}; \ No newline at end of file +}; -- cgit v1.2.3 From 1ddb43b0d32ab0dadb3fabc1ed79c96c4365eb77 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 20 Mar 2016 23:07:39 +0100 Subject: an attempt to visualize the supremacy of dont show over show in the acl selector --- view/js/acl.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'view/js') diff --git a/view/js/acl.js b/view/js/acl.js index 70440b572..65f1009ed 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -121,8 +121,10 @@ ACL.prototype.on_button_show = function(event) { event.stopImmediatePropagation(); event.stopPropagation(); - that.set_allow($(this).parent().attr('id')); - that.on_submit(); + if(!$(this).parent().hasClass("grouphide")) { + that.set_allow($(this).parent().attr('id')); + that.on_submit(); + } return false; }; @@ -245,12 +247,15 @@ ACL.prototype.update_view = function() { break; case "c": if (that.allow_cid.indexOf(id)>=0){ - btshow.removeClass("btn-default").addClass("btn-success"); - bthide.removeClass("btn-danger").addClass("btn-default"); + if(!$(this).hasClass("grouphide") ) { + btshow.removeClass("btn-default").addClass("btn-success"); + bthide.removeClass("btn-danger").addClass("btn-default"); + } } if (that.deny_cid.indexOf(id)>=0){ btshow.removeClass("btn-success").addClass("btn-default"); bthide.removeClass("btn-default").addClass("btn-danger"); + $(this).removeClass("groupshow"); } } }); -- cgit v1.2.3