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

Only works on document load #21

Open
michaelobriena opened this issue May 29, 2015 · 3 comments
Open

Only works on document load #21

michaelobriena opened this issue May 29, 2015 · 3 comments

Comments

@michaelobriena
Copy link
Member

One second after the document is loaded, https://assets-beta.famo.us/embed/embed.js doesn't convert the famous-container into the iframe.

Check plunkr (hit run / see console in dev tools)

http://plnkr.co/edit/As2ewoxhQ896ygfzDQ8N?p=preview

So injecting famous-container after ajax requests, or rendering it with a timed ngIf (as in the example) won't work.

Copied from:

Famous/engine#193

@michaelobriena
Copy link
Member Author

If it is not there on page load, we should at least have an API for the embed script to do the embedding.

@isaldarriaga
Copy link

I faced the performance issues of mutation events.

they have changed in DOM 4 to mutation observers

https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
(https://www.youtube.com/watch?v=eRZ4pO0gVWw)

@isaldarriaga
Copy link

Solved with mutation observer (DOM 4).

Design: observe the document body (children and subtree) and if a valid "famous-container" element node is mutating (added), fire the embed's manage function for them.

http://plnkr.co/edit/O10LY5?p=preview

Tested in chrome 43, FF 38.

Still doesn't work in IE11 because "promise is undefined" (not related to this issue. maybe a new issue for this is required)
error in bundle.js 346 of my plunkr.

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

2 participants