I am using view_infinite_scroll to load new content. The images in the content loaded via AJAx are not being loaded. Is resp_img using a behavior to do the replacement with picturefill?

Comments

luksak’s picture

I solved the issue with this:

Drupal.behaviors.respImgAjax = {
  attach: function (context) {
    window.picturefill();
  }
};

Shouldn't, resp_img be doing this on it's own?

attiks’s picture

No resp_img uses a polyfill that only loads on window.load, but I like the solution

luksak’s picture

Should I create a patch that implements this? We would have to stop picturefill to run on window.log then.

attiks’s picture

Patch is always welcomed

luksak’s picture

Status: Active » Needs review
StatusFileSize
new1.86 KB

There you go. I removed the event listeners from picturefill, except the resize event listener.

attiks’s picture

Status: Needs review » Needs work
+++ picturefill/resp_img.jsundefined
@@ -0,0 +1,10 @@
+  ¶

trailing whitespace

+++ picturefill/resp_img.jsundefined
@@ -0,0 +1,10 @@
+      alert('test');

some test code

luksak’s picture

StatusFileSize
new1.85 KB

Fixing the code style

luksak’s picture

Status: Needs work » Needs review
attiks’s picture

Status: Needs review » Fixed

I got this error while trying to apply the patch: "fatal: git diff header lacks filename information when removing 1 leading pathname components (line 45)"

So I did it by hand

Can you test it?

luksak’s picture

I already switched to picture. If I have time, I will test it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.