Skip to content

Commit

Permalink
Make sure imgs with src='' don't misreport their hiddenness
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Eberle committed May 19, 2015
1 parent 90cbac8 commit 1802cea
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2036,8 +2036,14 @@ imgix.FluidSet = function (options) {
};

imgix.FluidSet.prototype.updateSrc = function (elem, pinchScale) {
// An empty src attribute throws off the 'hidden' check below,
// so we need to give it something to actually fill it up
if (elem.hasAttribute('src') && elem.getAttribute('src') === '') {
elem.setAttribute('src', imgix.getEmptyImage());
}

// Short-circuit if the image is hidden
if (!elem.getClientRects().length) {
if (!elem.offsetWidth && !elem.offsetHeight && !elem.getClientRects().length) {
return;
}

Expand Down Expand Up @@ -2096,6 +2102,7 @@ imgix.FluidSet.prototype.updateSrc = function (elem, pinchScale) {
return;
}


if (!elem.fluidUpdateCount) {
elem.fluidUpdateCount = 0;
}
Expand Down

0 comments on commit 1802cea

Please sign in to comment.