Skip to content

Commit

Permalink
expose isExpanded
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfluegge committed Jan 1, 2025
1 parent 6cd01dc commit 8d721a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
24 changes: 4 additions & 20 deletions webapp/src/app/component/navigation/sidenav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,7 @@
class="icon-button-chevron"
>
<mat-icon>
{{
documentTree.treeControl.isExpanded(node)
? "expand_more"
: "chevron_right"
}}
{{ isExpanded(node) ? "expand_more" : "chevron_right" }}
</mat-icon>
</button>
Pinned
Expand All @@ -169,11 +165,7 @@
class="icon-button-chevron"
>
<mat-icon>
{{
documentTree.treeControl.isExpanded(node)
? "expand_more"
: "chevron_right"
}}
{{ isExpanded(node) ? "expand_more" : "chevron_right" }}
</mat-icon>
</button>
<span>Documents</span>
Expand All @@ -192,11 +184,7 @@
class="icon-button-chevron"
>
<mat-icon>
{{
documentTree.treeControl.isExpanded(node)
? "expand_more"
: "chevron_right"
}}
{{ isExpanded(node) ? "expand_more" : "chevron_right" }}
</mat-icon>
</button>
Trash
Expand Down Expand Up @@ -365,11 +353,7 @@
>
<button mat-icon-button matTreeNodeToggle class="icon-button-chevron">
<mat-icon>
{{
documentTree.treeControl.isExpanded(node)
? "expand_more"
: "chevron_right"
}}
{{ isExpanded(node) ? "expand_more" : "chevron_right" }}
</mat-icon>
</button>
<span
Expand Down
4 changes: 4 additions & 0 deletions webapp/src/app/component/navigation/sidenav.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ export class SidenavComponent implements OnInit, AfterViewInit {
Auth.signOut();
}

isExpanded(node: DocumentFlatNode): boolean {
return this.documentTree.isExpanded(node);
}

// Drag & Drop
dragStart() {
this.dragging = true;
Expand Down
4 changes: 4 additions & 0 deletions webapp/src/app/service/document-tree-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,10 @@ export class DocumentTree {
return node.lastModified;
}

isExpanded(node: DocumentFlatNode) {
return this.treeControl.isExpanded(node);
}

/*
find all visible nodes regardless of the level, except the dragged node, and return it as a flat list
*/
Expand Down

0 comments on commit 8d721a7

Please sign in to comment.