Get category icons working

This commit is contained in:
nathan 2024-02-15 10:41:40 -07:00
parent bebd121b60
commit a60299e114
2 changed files with 3 additions and 2 deletions

View File

@ -398,14 +398,14 @@ export class Et2TreeDropdown extends Et2WidgetWithSelectMixin(LitElement)
*/
protected iconTemplate(option)
{
if(!option.icon)
if(!option.icon && !option.im0)
{
return html``;
}
return html`
<et2-image slot="prefix" part="icon" style="width: var(--icon-width)"
src="${option.icon}"></et2-image>`
src="${option.icon ?? option.im0}"></et2-image>`
}
inputTemplate()

View File

@ -539,6 +539,7 @@ class Tree extends Etemplate\Widget
*/
'value' => $cat['id'],
'label' => $s,
'icon' => $cat['data']['icon'] ?: '',
'title' => $cat['description']
);
$cat_id_list[] = $cat['id'];