]> git.mxchange.org Git - friendica.git/blobdiff - js/acl.js
Keep html in template, use data attribute for img
[friendica.git] / js / acl.js
index 4f43252847ff6ae9ef487aff5583fad0f2d572c4..36cf74970fbac1e83df66fa67da46f4d0711040c 100644 (file)
--- a/js/acl.js
+++ b/js/acl.js
@@ -247,12 +247,17 @@ ACL.prototype.populate = function(data){
        var height = Math.ceil(data.tot / that.nw) * 42;
        that.list_content.height(height);
        $(data.items).each(function(){
-               html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'><img src='{0}'/><p>{1}</p>"+that.item_tpl+"</div>";
-               html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link );
+               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);
                if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
                //console.log(html);
                that.list_content.append(html);
        });
+       $(".acl-list-item img[data-src]").each(function(i, el){
+               // Replace data-src attribute with src attribute for every image
+               $(el).attr('src', $(el).data("src"));
+               $(el).removeAttr("data-src");
+       });
        that.update_view();
 }