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

Is there an event that I can subscribe to when an Item is added to the DOM? #32

Closed
wiscow opened this issue Jan 19, 2015 · 2 comments
Closed

Comments

@wiscow
Copy link

wiscow commented Jan 19, 2015

I am currently using a plugin that accesses items that are currently on the DOM through document.getElementByID. Searching though the code, it looks like function that adds components to the layout happens before the ContentItem is actually added to the DOM. This is causing problems in the plugin. I gave the item added event a shot but that seems to fire before the item is added. The one event that kind of worked was to subscribe to the 'open' event of the container, but that only fires once when the container is first loaded and has been added to the DOM. We are currently using Backbone as a framework and what i am trying to achieve is to call render() on my view after the contentitem has been added to the DOM. Got any ideas? Any help would be appreciated, I can provide examples if need be.

Thanks!

@deepstreamIO
Copy link
Contributor

Hi Kyle,

just for my understanding. You mention* '**The one event that kind of
worked was to subscribe to the 'open' event of the container, but that only
fires once when the container is first loaded and has been added to the
DOM' *which is exactly right. But if you're not looking for the event that
fires when the container is first added to the DOM (where it stays until
it's destroyed), what exactly are you looking for?

Cheers,

Wolfram

2015-01-19 22:28 GMT+00:00 Kyle MacDonald notifications@github.com:

I am currently using a plugin that accesses items that are currently on
the DOM through document.getElementByID. Searching though the code, it
looks like function that adds components to the layout happens before the
ContentItem is actually added to the DOM. This is causing problems in the
plugin. I gave the item added event a shot but that seems to fire before
the item is added. The one event that kind of worked was to subscribe to
the 'open' event of the container, but that only fires once when the
container is first loaded and has been added to the DOM. We are currently
using Backbone as a framework and what i am trying to achieve is to call
render() on my view after the contentitem has been added to the DOM. Got
any ideas? Any help would be appreciated, I can provide examples if need be.

Thanks!


Reply to this email directly or view it on GitHub
#32.

@wiscow
Copy link
Author

wiscow commented Jan 20, 2015

Hey Wolfram,

On futher inspection "Open" on the container works as expected. I was interpreting the variable incorrectly. Thanks for the response!

Kyle

@wiscow wiscow closed this as completed Jan 20, 2015
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

1 participant