-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove sub-folders from open folders array when closing it's parent #130
Conversation
if (isFolderOpen) { | ||
vm.expandedNodes.splice(folderIndex, 1); | ||
} | ||
} |
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.
Missing semicolon after statement
Recursive is a bit of an overkill here. Basically, because every path of every child will have the collapsed folder as a prefix, you can just go over the array and remove all items that have the path as a prefix |
Great for making our convention forthe "folder" name more consistent |
You can use this to filter the strings you don't want |
var closeFolder = function(folder) { | ||
var nameIndex = folder.path.indexOf(folder.name); | ||
var pathPrefix = folder.path.substr(0, nameIndex) + folder.name; | ||
|
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.
Illegal trailing whitespace
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.
@houndci-bot
good boy, now work again!
Sorry for the nits, but maybe use |
@thatkookooguy |
@ortichon Haha same here. Didn't new about it before. Just tried to look something up 😂 |
Remove sub-folders from open folders array when closing it's parent
Change Summary
More info
the function iterates trough all the current sub-folders, checks if they have additional open sub-folders, and remove them all from the
expandedNodes
arrayBefore you submit a PR, make sure you did the following things: