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

Hocks vs. viewportEntered #26

Closed
fsmanuel opened this issue Apr 29, 2015 · 2 comments · Fixed by #27
Closed

Hocks vs. viewportEntered #26

fsmanuel opened this issue Apr 29, 2015 · 2 comments · Fixed by #27

Comments

@fsmanuel
Copy link
Contributor

@poteto What is the recommended way to catch the viewportEntered changes. We are using both and that breaks the addon:
https://github.com/twokul/ember-lazy-image/blob/master/addon/components/lazy-image.js#L36-L47

You first trigger the event and than set viewportEntered:
https://github.com/dockyard/ember-in-viewport/blob/76cc70431d025cff28fd2f775490e8fc36cc5535/addon/mixins/in-viewport.js#L145-L147

In our case the set seems to be too late and the image will never be visible.

As I understand it we no longer need to check if (viewportEntered && lazyUrl === "//:0") { is that correct?

@poteto
Copy link
Contributor

poteto commented Apr 29, 2015

You're right, it's actually a bug with ember-in-viewport. It should be set before it is triggered. The recommended way is to use didEnterViewport, and I'll submit a PR to remove the now redundant check once I have that bugfix in.

Thanks for reporting!

@fsmanuel
Copy link
Contributor Author

Thanks for the great improvements!

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 a pull request may close this issue.

2 participants