Skip to content

Commit

Permalink
remove support conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
leaferjs committed Sep 26, 2024
1 parent a757f86 commit 63e1faf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/display/src/Branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ export class Branch extends Leaf { // tip: rewrited Group
public remove(child?: ILeaf, destroy?: boolean): void {
if (child) {

if ((child as ILeaf).animationOut) child.__runAnimation('out', () => this.__remove(child, destroy))
else this.__remove(child, destroy)
if (child.__) {

if ((child as ILeaf).animationOut) child.__runAnimation('out', () => this.__remove(child, destroy))
else this.__remove(child, destroy)

} else this.find(child as any).forEach(item => this.remove(item, destroy)) //

} else if (child === undefined) {
super.remove(null, destroy)
Expand Down
2 changes: 1 addition & 1 deletion packages/display/src/Leaf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ export class Leaf implements ILeaf {

public add(_child: ILeaf | ILeafInputData, _index?: number): void { }

public remove(_child?: ILeaf, destroy?: boolean): void {
public remove(_child?: ILeaf | number | string | IFindMethod, destroy?: boolean): void {
if (this.parent) this.parent.remove(this, destroy)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/interface/src/display/ILeaf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,

__updateSortChildren(): void
add(child: ILeaf | ILeafInputData, index?: number): void
remove(child?: ILeaf, destroy?: boolean): void
remove(child?: ILeaf | number | string | IFindMethod, destroy?: boolean): void
dropTo(parent: ILeaf, index?: number, resize?: boolean): void
}

Expand Down

0 comments on commit 63e1faf

Please sign in to comment.