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

Feature request: did-enter-viewport and did-exit-viewport element modifiers #177

Closed
gmurphey opened this issue Mar 4, 2019 · 4 comments · Fixed by #179
Closed

Feature request: did-enter-viewport and did-exit-viewport element modifiers #177

gmurphey opened this issue Mar 4, 2019 · 4 comments · Fixed by #179

Comments

@gmurphey
Copy link
Contributor

gmurphey commented Mar 4, 2019

Would be awesome to be able to do things like:

<div
  {{did-enter-viewport enterCallback}}
  {{did-exit-viewport exitCallback}}
>
  Foo
</div>

Where enterCallback and exitCallback are functions or actions that receive the element as a parameter.

@snewcomer
Copy link
Collaborator

Interesting idea and thx for putting up an issue. So you are referring to this RFC I'm guessing? https://github.com/emberjs/rfcs/pull/353/files

Since these functions are called once I believe, what exactly would these modifiers do? What happens when they elements they are bound to are not in viewport, but are still only called once (ie. not watchign the DOM)

@snewcomer
Copy link
Collaborator

@gmurphey Is this something you would want to work on? Otherwise, I'll see about getting it done on our side!

@snewcomer
Copy link
Collaborator

I'm starting work on this. There is quite a bit to do, including ensuring we have a shared cache that can be referenced across boundaries (mixin / modifier)

@snewcomer
Copy link
Collaborator

@gmurphy #179. Seems pretty simple and would require installing https://github.com/emberjs/ember-render-modifiers and using the ‘did-insert’ hook. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants