From 311940fccc66e12b7eb611f383665532e8e4cbca Mon Sep 17 00:00:00 2001 From: Carlo Barone Date: Mon, 8 Jan 2024 16:28:59 +0100 Subject: [PATCH] feat: showing only the latest child node in treenode navigator --- cosmoz-treenode-button-view.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cosmoz-treenode-button-view.js b/cosmoz-treenode-button-view.js index 63c34b6..ddd4a85 100644 --- a/cosmoz-treenode-button-view.js +++ b/cosmoz-treenode-button-view.js @@ -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.