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

move inview logic into ComponentView #2269

Closed
moloko opened this issue Nov 13, 2018 · 4 comments
Closed

move inview logic into ComponentView #2269

moloko opened this issue Nov 13, 2018 · 4 comments
Assignees

Comments

@moloko
Copy link
Contributor

moloko commented Nov 13, 2018

Since the assessmentResults, blank, text, graphic, hotgraphic, narrative & media components all implement inview it seems like a sensible idea to move as much of the logic as possible into ComponentView. And now seems like quite a good time to do it!

The implementation in adapt-contrib-text seems like a pretty good starting point - particularly in terms of how it allows some flexibility as to what the 'inview element' should be.

I think we would need three functions:

  1. setupInviewListenersetupInviewCompletion
  2. onInview
  3. removeInviewListener

Plus a model property inviewElementSelector

If that sounds OK by everyone I'm happy to pick this up.

@oliverfoster
Copy link
Member

Yup, perfect.

@moloko
Copy link
Contributor Author

moloko commented Nov 14, 2018

OK I've done the core code update and done PRs for the following components:

  • blank
  • text
  • assessment results

As they give a good flavour of the three different ways this can be used:

  1. default settings (blank)
  2. having inview attached to a different DOM element (text)
  3. using a different callback function (assessment results)

If everyone's OK with those I'll do PRs for:

  • graphic
  • hot graphic
  • narrative
  • media

I was also thinking we could take this opportunity to add inview functionality to accordion - currently it's the only presentation component that doesn't support inview.

@brian-learningpool
Copy link
Member

@moloko, is this something which is intended to go into v4?

@moloko
Copy link
Contributor Author

moloko commented Nov 14, 2018

@brian-learningpool yep that's the idea

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

No branches or pull requests

3 participants