Implement add on selected container
This commit is contained in:
parent
092b156cc0
commit
893b525d45
3 changed files with 35 additions and 7 deletions
|
@ -35,4 +35,16 @@ export class Container extends React.Component<IContainerProps> {
|
|||
</g>
|
||||
);
|
||||
}
|
||||
|
||||
public static getDepth(container: Container): number {
|
||||
let depth = 0;
|
||||
|
||||
let current: Container | null = container.props.parent;
|
||||
while (current != null) {
|
||||
depth++;
|
||||
current = current.props.parent;
|
||||
}
|
||||
|
||||
return depth;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue