Fix retina.js with images not currently visible on the page.

Review Request #5504 — Created Feb. 18, 2014 and submitted

Information

Review Board
master
4f611bf...

Reviewers

retina.js has a bug (which has a few issues and pull requests filed)
where any images not currently displayed (either through display: none on
the image or on a parent) will end up with a width and height of 0.

The solution appears to be to use the naturalWidth and naturalHeight
properties instead of offsetWidth and offsetHeight. Others have deployed
this without problems, and it works for the cases I've hit as well.

The problem is that we now have to maintain this, but hopefully the next
time retina.js puts out a release, it'll include a fix.

Hit this issue with the new change description stuff. Any file attachments
shown on a collapsed box ended up with a 0 width and height.

After this fix, I could see the images, and they had a correct width and height.

david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...