forked from openMF/web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhanced the Collapse all or Expand All button by implementing both i…
…n the same button and also fix the translation for both
- Loading branch information
1 parent
d846a80
commit 8ac82cc
Showing
5 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { NestedTreeControl } from '@angular/cdk/tree'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class TreeControlService { | ||
constructor() { } | ||
|
||
toggleExpandCollapse(nestedTreeControl: NestedTreeControl<any>, isTreeExpanded: boolean) { | ||
if (isTreeExpanded) { | ||
nestedTreeControl.collapseAll(); | ||
} else { | ||
nestedTreeControl.expandAll(); | ||
} | ||
// Toggle the state | ||
return !isTreeExpanded; | ||
} | ||
} |