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

JS event when all cells have been rendered to page? #338

Closed
timkpaine opened this issue Aug 2, 2019 · 5 comments
Closed

JS event when all cells have been rendered to page? #338

timkpaine opened this issue Aug 2, 2019 · 5 comments

Comments

@timkpaine
Copy link
Member

I'm trying to hook in a materialize init of some select elements, but i need to know that they've been placed on the page first:

https://materializecss.com/select.html
@martinRenou (https://github.com/martinRenou/voila-material)

Also will be useful for a custom loading screen.

@timkpaine
Copy link
Member Author

timkpaine commented Aug 5, 2019

My workaround right now will be to inject a bit of javascript into the last cell of a notebook which creates and emits a custom event.

As far as real solutions are concerned, would it make sense to emit an event when we receive the final "kernel idle" message from the last cell? This would let the front end know when the webpage is ready. I could then attach some javascript to this to initialize materialize, or to hide my loading screen, etc.

@jtpio
Copy link
Member

jtpio commented Aug 6, 2019

Maybe something that can be achieved with progressive rendering? #133

@timkpaine
Copy link
Member Author

@jtpio I can try it but I was hoping to ship all the javascript at the beginning, if need be it looks like i can send a script block after the last execute and it will definitely be synchronous?

@maartenbreddels
Copy link
Member

I think indeed that #133 should have per cell rendering, and call some js function that can show/update a progress bar, or some custom code. Would that solve your problem?

@timkpaine
Copy link
Member Author

@maartenbreddels i think so!

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