Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue/1873 #2268

Merged
merged 3 commits into from
Nov 14, 2018
Merged

Fix for issue/1873 #2268

merged 3 commits into from
Nov 14, 2018

Conversation

chris-steele
Copy link
Contributor

@chris-steele chris-steele commented Nov 12, 2018

#1873

  • Update to inview to read computed styles

if (cssHidden) return true;

var style = window.getComputedStyle(element, null);
cssHidden = (style.display == "none" || style.visibility == "hidden");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good opportunity to switch to strict equality checks here and on L570?

Copy link
Contributor

@tomgreenfield tomgreenfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to retain compatibility with IE8.

@chris-steele
Copy link
Contributor Author

@tomgreenfield sorry thought the last two commits on master to inview had removed IE8 support. Should have tested it... which I have now done ;-)

@@ -570,8 +570,7 @@
var cssHidden = (element.style.display == "none" || element.style.visibility == "hidden");
if (cssHidden) return true;

var style = window.getComputedStyle(element, null);
cssHidden = (style.display == "none" || style.visibility == "hidden");
cssHidden = $(element).css("display") === "none" || $(element).css("visibility") === "hidden";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth caching $(element)? or am I just being too picky?

Copy link
Contributor

@tomgreenfield tomgreenfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁

@chris-steele chris-steele merged commit 06ae999 into legacy Nov 14, 2018
@chris-steele chris-steele deleted the issue/#2267 branch November 14, 2018 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants