Skip to content
Snippets Groups Projects
Commit eaf0911e authored by Marie Verdonck's avatar Marie Verdonck
Browse files

66391: Fixed the valse positive chevron indicating node is expandable

parent 84326ef5
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<button type="button" class="btn btn-default" cdkTreeNodeToggle <button type="button" class="btn btn-default" cdkTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name" [attr.aria-label]="'toggle ' + node.name"
(click)="toggleExpanded(node)" (click)="toggleExpanded(node)"
[ngClass]="node.isExpandable ? 'visible' : 'invisible'"> [ngClass]="(node.isExpandable$ | async) ? 'visible' : 'invisible'">
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}" <span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
aria-hidden="true"></span> aria-hidden="true"></span>
</button> </button>
......
...@@ -14,7 +14,7 @@ export class CommunityListComponent implements OnInit { ...@@ -14,7 +14,7 @@ export class CommunityListComponent implements OnInit {
public loadingNode: FlatNode; public loadingNode: FlatNode;
treeControl = new FlatTreeControl<FlatNode>( treeControl = new FlatTreeControl<FlatNode>(
(node) => node.level, (node) => node.isExpandable (node) => node.level, (node) => true
); );
dataSource: CommunityListDatasource; dataSource: CommunityListDatasource;
...@@ -29,7 +29,7 @@ export class CommunityListComponent implements OnInit { ...@@ -29,7 +29,7 @@ export class CommunityListComponent implements OnInit {
// whether or not this node has children (subcommunities or collections) // whether or not this node has children (subcommunities or collections)
hasChild(_: number, node: FlatNode) { hasChild(_: number, node: FlatNode) {
return node.isExpandable; return node.isExpandable$;
} }
// whether or not it is a show more node (contains no data, but is indication that there are more topcoms, subcoms or collections // whether or not it is a show more node (contains no data, but is indication that there are more topcoms, subcoms or collections
...@@ -68,15 +68,13 @@ export class CommunityListComponent implements OnInit { ...@@ -68,15 +68,13 @@ export class CommunityListComponent implements OnInit {
getNextPage(node: FlatNode): void { getNextPage(node: FlatNode): void {
this.loadingNode = node; this.loadingNode = node;
if (node.parent != null) { if (node.parent != null) {
if (node.parent.isExpandable) { if (node.id === 'collection') {
if (node.id === 'collection') { const parentNodeInExpandedNodes = this.expandedNodes.find((node2: FlatNode) => node.parent.id === node2.id);
const parentNodeInExpandedNodes = this.expandedNodes.find((node2: FlatNode) => node.parent.id === node2.id); parentNodeInExpandedNodes.currentCollectionPage++;
parentNodeInExpandedNodes.currentCollectionPage++; }
} if (node.id === 'community') {
if (node.id === 'community') { const parentNodeInExpandedNodes = this.expandedNodes.find((node2: FlatNode) => node.parent.id === node2.id);
const parentNodeInExpandedNodes = this.expandedNodes.find((node2: FlatNode) => node.parent.id === node2.id); parentNodeInExpandedNodes.currentCommunityPage++;
parentNodeInExpandedNodes.currentCommunityPage++;
}
} }
this.dataSource.loadCommunities(this.expandedNodes); this.dataSource.loadCommunities(this.expandedNodes);
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment