Skip to content

Commit

Permalink
simplify width calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Aug 4, 2015
1 parent cf77586 commit 8273cb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lazysizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
(eLleft = rect.left) <= eLvW &&
(eLbottom || eLright || eLleft || eLtop) &&
((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
unveilElement(lazyloadElems[i], rect.width);
unveilElement(lazyloadElems[i]);
loadedSomething = true;
if(isLoading > 6){currentExpand = shrinkExpand;}
} else if(!loadedSomething && isCompleted && !autoLoadElem &&
Expand Down Expand Up @@ -270,8 +270,8 @@
};
})();

var unveilElement = function (elem, width){
var sources, i, len, sourceSrcset, src, srcset, parent, isPicture, event, firesLoad, customMedia;
var unveilElement = function (elem){
var sources, i, len, sourceSrcset, src, srcset, parent, isPicture, event, firesLoad, customMedia, width;

var isImg = regImg.test(elem.nodeName);

Expand All @@ -282,7 +282,7 @@
if( (isAuto || !isCompleted) && isImg && (elem.src || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesConfig.errorClass)){return;}

if(isAuto){
width = Math.max(width || 0, elem.offsetWidth);
width = elem.offsetWidth;
}

elem._lazyRace = true;
Expand Down
2 changes: 1 addition & 1 deletion lazysizes.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8273cb1

Please sign in to comment.