-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix missing expand/collapse tree icon when refreshing page #2681
Fix missing expand/collapse tree icon when refreshing page #2681
Conversation
Thanks for this one too @rasmusjp! We'll look over it shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rasmusjp
This is ace for two reasons. One, you've made ten lines of code into one and it does the job nicely. Two, this had been bothering me too ;)
I've tested it and am happy to approve. Thanks for your work,
Emma
It is absolutely amazing we are getting closer to fix this issue because it is a little bit annoying. One thing we have to keep in mind before merging: The reason why we moved the logic from the template to the link function was part of a performance improvement. If you have many nodes in the tree a lot of watchers can bring Angular to its knees. The PR will bring back an "ng-style" which might be okay but it will add to the numbers of watchers on the tree. |
@madsrasmussen Sure, I'll gladly look into solving this another way. But looking at the history From what I can see the problem occurs in the first place because loadNodeChildren() calls removeChildNodes() which sets So maybe adding a way to trigger a "node refresh" when Please let me know if I should look into doing that instead |
This fixes the expand/collapse icon not being show when a tree is autoexpanded, e.g. when refreshing the page
I've updated the PR, so now instead of adding This shouldn't have any impact on the performance on large trees and the result should be the same. @emmaburstow , would you have a look again and verify it still works as expected? |
hi @rasmusjp! Sure, I'll have a look tonight :) Thanks for that Emma |
Also there's no need to send the node to the function since it's the same node, so better save some compute power there too
Hi @rasmusjp - all good here at my end! @madsrasmussen are you happy with the changes? |
Awesome! If all tests are OK then I think we are good to go 🎉 |
Great stuff! Thanks @rasmusjp 👍 |
Prerequisites
Description
This fixes expand/collapse tree icons not being shown in the navigation tree when the page is refreshed
Before:
After: