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

Add API for listening to DOM element modifications #360

Closed
oliverfoster opened this issue Apr 26, 2023 · 1 comment · Fixed by #361
Closed

Add API for listening to DOM element modifications #360

oliverfoster opened this issue Apr 26, 2023 · 1 comment · Fixed by #361

Comments

@oliverfoster
Copy link
Member

oliverfoster commented Apr 26, 2023

Subject of the issue

Sometimes it's necessary to listen for dom modifications using the MutationObserver browser API. A standardised API can be provided in Adapt to make this API useful for handling many types of dynamically injected content in Adapt. By providing a single point of observing changes, we can reduce the processing overhead for this type of operation and stabalise its utilisation.

Current uses:

  • GraphicLottie Allows the use of animated svgs in place of img, it does this by replacing img tags with svg players
  • Navigation Button API Listens for injected buttons in order to make models and views for managing them via an API

Possible future uses:

  • Tooltips API To allow permanent tooltips to be rendered when a [data-tooltip-id] element is injected
  • Resources To inject resources into content using a simple <resources id='resource1' /> style tag
  • Glossary To inject clickable areas into content using a simple <glossary term="Term" /> style tag
@oliverfoster
Copy link
Member Author

🎉 This issue has been resolved in version 6.38.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

1 participant