Skip to content

Commit

Permalink
feat: showing only the latest child node in treenode navigator
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloBar1 committed Oct 24, 2024
1 parent 99efe6a commit 311940f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cosmoz-treenode-button-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,13 @@ class CosmozTreenodeButtonView extends translatable(PolymerElement) {
if (!Array.isArray(pathParts) || pathParts.length === 0) {
return placeholder;
}
return pathParts
let labels = pathParts
.filter((n) => n)
.map((part) => part[this.tree.searchProperty])
.join(' / ');
.map((part) => part[this.tree.searchProperty]);

return pathParts.length === 1
? labels[0]
: '.../' + labels[pathParts.length - 1];
}
/**
* Get text from a node to set on a node chip.
Expand Down

0 comments on commit 311940f

Please sign in to comment.