From bebd121b60b82556ed916befe58cc4ff156e0be8 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 15 Feb 2024 10:35:06 -0700 Subject: [PATCH] Show leaf path as title/tooltip --- api/js/etemplate/Et2Tree/Et2TreeDropdown.ts | 1 + api/src/Etemplate/Widget/Tree.php | 1 + 2 files changed, 2 insertions(+) diff --git a/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts b/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts index 88abad03ed..e7ac978802 100644 --- a/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts +++ b/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts @@ -470,6 +470,7 @@ export class Et2TreeDropdown extends Et2WidgetWithSelectMixin(LitElement) tabindex="-1" variant=${isValid ? nothing : "danger"} size=${this.size || "medium"} + title=${option.path ?? option.title} ?removable=${!readonly} ?readonly=${readonly} ?editable=${isEditable} diff --git a/api/src/Etemplate/Widget/Tree.php b/api/src/Etemplate/Widget/Tree.php index 8fc3de81de..783ff6ce4d 100644 --- a/api/src/Etemplate/Widget/Tree.php +++ b/api/src/Etemplate/Widget/Tree.php @@ -530,6 +530,7 @@ class Tree extends Etemplate\Widget // 1D array $category = $cat + array( 'text' => $s, + 'path' => $categories->id2name($cat['id'], 'path'), /* These ones to play nice when a user puts a tree & a selectbox with the same