]> git.mxchange.org Git - friendica.git/blobdiff - js/acl.js
Don't replace data-src with src in acl-template
[friendica.git] / js / acl.js
index 12045fe521fedb3036a98f447ea54840621cb3a3..35342a5c14ad52891708f2cec9e119f7d61507f5 100644 (file)
--- a/js/acl.js
+++ b/js/acl.js
@@ -171,6 +171,9 @@ ACL.prototype.update_view = function(){
                                $('.profile-jot-net input').attr('disabled', 'disabled');                       
                                $('#profile-jot-desc').html(' ');
        }
+       $("#acl-list-content .acl-list-item").each(function(){
+               $(this).removeClass("groupshow grouphide");
+       });
        
        $("#acl-list-content .acl-list-item").each(function(){
                itemid = $(this).attr('id');
@@ -193,10 +196,18 @@ ACL.prototype.update_view = function(){
                                        bthide.addClass("selected");
                                        uclass="grouphide";
                                }
-
-
-                               $(that.group_uids[id]).each(function(i,v){
-                                       $("#c"+v).removeClass("groupshow grouphide").addClass(uclass);
+                               
+                               $(that.group_uids[id]).each(function(i,v) {
+                                       if(uclass == "grouphide")
+                                               $("#c"+v).removeClass("groupshow");
+                                       if(uclass != "") {
+                                               var cls = $("#c"+v).attr('class');
+                                               if( cls == undefined)
+                                                       return true;
+                                               var hiding = cls.indexOf('grouphide');
+                                               if(hiding == -1)
+                                                       $("#c"+v).addClass(uclass);
+                                       }
                                });
                                
                                break;
@@ -209,8 +220,6 @@ ACL.prototype.update_view = function(){
                                        btshow.removeClass("selected");
                                        bthide.addClass("selected");
                                }                       
-                       default:
-                               break;
                }
                
        });
@@ -239,11 +248,15 @@ ACL.prototype.populate = function(data){
        that.list_content.height(height);
        $(data.items).each(function(){
                html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
-               html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link );
+               html = html.format(this.photo, this.name, this.type, this.id, '', this.network, this.link);
                if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
                //console.log(html);
                that.list_content.append(html);
        });
+       $(".acl-list-item[rel!=acl-template] img[data-src]").each(function(i, el){
+               // Add data-src attribute with src attribute for every image
+               $(el).attr('src', $(el).data("src"));
+       });
        that.update_view();
 }