Skip to content

fix(tree): fix dynamic tree example and demo not closing children (#11148) #11728

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

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

victoriaaa234
Copy link
Contributor

No description provided.

@victoriaaa234 victoriaaa234 requested a review from tinayuangao June 9, 2018 01:51
@googlebot googlebot added the cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla label Jun 9, 2018
@victoriaaa234 victoriaaa234 added cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release and removed cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla labels Jun 9, 2018
@googlebot googlebot added cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Jun 9, 2018
@victoriaaa234 victoriaaa234 added cla: yes PR author has agreed to Google's Contributor License Agreement and removed cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla labels Jun 9, 2018
setTimeout(() => {
if (expand) {
const nodes = children.map(name =>
new DynamicFlatNode(name, node.level + 1, this.database.isExpandable(name)));
this.data.splice(index + 1, 0, ...nodes);
} else {
this.data.splice(index + 1, children.length);
for (let i = index + 1; i < this.data.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this better?

let count = 0;
for (let i = index + 1; i < this.data.length && this.data[i].level > node.level; i++, count++) {}?
this.data.splice(index + 1, count);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks! This definitely saves space

@tinayuangao tinayuangao changed the title Fix tree not closing children (#11148) fix(tree): fix dynamic tree example and demo not closing children (#11148) Jun 11, 2018
@googlebot googlebot added cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Jun 11, 2018
@victoriaaa234 victoriaaa234 added cla: yes PR author has agreed to Google's Contributor License Agreement and removed cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla labels Jun 11, 2018
@googlebot googlebot added cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Jun 11, 2018
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes PR author has agreed to Google's Contributor License Agreement and removed cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla labels Jun 11, 2018
@angular angular deleted a comment from googlebot Jun 11, 2018
@angular angular deleted a comment from googlebot Jun 11, 2018
@angular angular deleted a comment from googlebot Jun 11, 2018
@angular angular deleted a comment from googlebot Jun 11, 2018
@angular angular deleted a comment from googlebot Jun 11, 2018
@angular angular deleted a comment from googlebot Jun 11, 2018
@angular angular deleted a comment from googlebot Jun 11, 2018
Copy link
Contributor

@tinayuangao tinayuangao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants