Skip to content

Commit

Permalink
clarify height calculation (fixes aFarkas#709)
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Oct 5, 2019
1 parent 7ac087e commit 01fe486
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
5 changes: 2 additions & 3 deletions lazysizes-umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
var requestIdleCallback = window.requestIdleCallback;

var regPicture = /^picture$/i;
var regLoadElements = /^img|iframe$/i;

var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded'];

Expand Down Expand Up @@ -316,7 +315,7 @@
isBodyHidden = getCSS(document.body, 'visibility') == 'hidden';
}

return isBodyHidden || (getCSS(elem.parentNode, 'visibility') != 'hidden' && getCSS(elem, 'visibility') != 'hidden');
return isBodyHidden || !(getCSS(elem.parentNode, 'visibility') == 'hidden' && getCSS(elem, 'visibility') == 'hidden');
};

var isNestedVisible = function(elem, elemExpand){
Expand Down Expand Up @@ -484,7 +483,7 @@
isPicture = parent && regPicture.test(parent.nodeName || '');
}

firesLoad = detail.firesLoad || !!(('src' in elem && regLoadElements.test(elem.nodeName)) && (srcset || src || isPicture));
firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture));

event = {target: elem};

Expand Down
2 changes: 1 addition & 1 deletion lazysizes-umd.min.js

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

5 changes: 2 additions & 3 deletions lazysizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
var requestIdleCallback = window.requestIdleCallback;

var regPicture = /^picture$/i;
var regLoadElements = /^img|iframe$/i;

var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded'];

Expand Down Expand Up @@ -314,7 +313,7 @@
isBodyHidden = getCSS(document.body, 'visibility') == 'hidden';
}

return isBodyHidden || (getCSS(elem.parentNode, 'visibility') != 'hidden' && getCSS(elem, 'visibility') != 'hidden');
return isBodyHidden || !(getCSS(elem.parentNode, 'visibility') == 'hidden' && getCSS(elem, 'visibility') == 'hidden');
};

var isNestedVisible = function(elem, elemExpand){
Expand Down Expand Up @@ -482,7 +481,7 @@
isPicture = parent && regPicture.test(parent.nodeName || '');
}

firesLoad = detail.firesLoad || !!(('src' in elem && regLoadElements.test(elem.nodeName)) && (srcset || src || isPicture));
firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture));

event = {target: elem};

Expand Down
Loading

0 comments on commit 01fe486

Please sign in to comment.