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

Loaded.jstree event handler not always called #111

Open
Edminsson opened this issue Apr 12, 2017 · 1 comment
Open

Loaded.jstree event handler not always called #111

Edminsson opened this issue Apr 12, 2017 · 1 comment

Comments

@Edminsson
Copy link

I have a problem with a loaded.jstree event handler that I use to call the open_all function in jstree. Sometimes it gets called and sometimes not. When I debug I can see that jstree triggers the loaded.jstree event but it seems to me that, since manageEvents is being wrapped in a timeout function, the event is triggered before manageEvents gets called. Hence the event is triggered before the event handler is registered.
I've only experienced this in IE11.

@Edminsson
Copy link
Author

Edminsson commented Apr 13, 2017

It's not easy to debug this problem because it behaves differently when I put breakpoints in the code. But by using console.logs in the right places I could confirm that sometimes the loaded.jstree event was triggered before the event handler was registered and sometimes the other way around. Basically you've got two pieces of code that run asynchronously and you can't be sure which one will run first.

Edminsson added a commit to Riksarkivet/ngJsTree that referenced this issue Sep 14, 2017
Removed timeout around call to manageEvents function.
Edminsson added a commit to Riksarkivet/ngJsTree that referenced this issue Sep 26, 2017
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