From: Olaf Conradi Date: Sun, 30 Dec 2012 23:01:15 +0000 (+0100) Subject: Don't replace data-src with src in acl-template X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6a2bd8b29fa8e7e4e70fc392a6c073ea3b518625;p=friendica.git Don't replace data-src with src in acl-template On pageload an empty acl-list-item as template is created and not yet replaced. Don't change the data-src for src attributes in those images. --- diff --git a/js/acl.js b/js/acl.js index 36cf74970f..35342a5c14 100644 --- a/js/acl.js +++ b/js/acl.js @@ -253,10 +253,9 @@ ACL.prototype.populate = function(data){ //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 + $(".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")); - $(el).removeAttr("data-src"); }); that.update_view(); } diff --git a/view/theme/frost-mobile/js/acl.js b/view/theme/frost-mobile/js/acl.js index 20f0d46189..c22991dd69 100644 --- a/view/theme/frost-mobile/js/acl.js +++ b/view/theme/frost-mobile/js/acl.js @@ -253,10 +253,9 @@ ACL.prototype.populate = function(data){ //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 + $(".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")); - $(el).removeAttr("data-src"); }); that.update_view(); } diff --git a/view/theme/frost/js/acl.js b/view/theme/frost/js/acl.js index 6b443b2481..95067f1749 100644 --- a/view/theme/frost/js/acl.js +++ b/view/theme/frost/js/acl.js @@ -253,10 +253,9 @@ ACL.prototype.populate = function(data){ //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 + $(".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")); - $(el).removeAttr("data-src"); }); that.update_view(); }