mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Et2SelectCatagory: Fix missing category icons & colors
This commit is contained in:
parent
9495dd48b9
commit
0f5a1a2b5a
@ -123,7 +123,7 @@ export class Et2SelectCategory extends Et2StaticSelectMixin(Et2TreeDropdown)
|
|||||||
let css = "";
|
let css = "";
|
||||||
const catColor = (option) =>
|
const catColor = (option) =>
|
||||||
{
|
{
|
||||||
css += ".cat_" + option.value + " {--category-color: " + (option.data?.color || "transparent") + ";}\n";
|
css += ".cat_" + option.value + " {--category-color: var(--cat-" + option.value + "-color ,transparent);}\n";
|
||||||
|
|
||||||
if (typeof option.children === 'object')
|
if (typeof option.children === 'object')
|
||||||
{
|
{
|
||||||
|
@ -872,16 +872,6 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
|
|||||||
}
|
}
|
||||||
//fallback to try and set icon if everything else failed
|
//fallback to try and set icon if everything else failed
|
||||||
if (!img) img = selectOption.icon ?? selectOption.im0 ?? selectOption.im1 ?? selectOption.im2;
|
if (!img) img = selectOption.icon ?? selectOption.im0 ?? selectOption.im1 ?? selectOption.im2;
|
||||||
if (img?.endsWith(".png"))
|
|
||||||
{
|
|
||||||
//sl-icon images need to be svgs if there is a png try to find the corresponding svg
|
|
||||||
img = img.replace(".png", ".svg");
|
|
||||||
}
|
|
||||||
//append image path, if img is only relative (does not start with / or https://)
|
|
||||||
if (img && typeof img === "string" && !img.match(/^(\/|https?:\/\/)/))
|
|
||||||
{
|
|
||||||
img = this.imagePath + img;
|
|
||||||
}
|
|
||||||
|
|
||||||
// lazy iff "child" is set and "item" is empty or item does not exist in the first place
|
// lazy iff "child" is set and "item" is empty or item does not exist in the first place
|
||||||
const lazy = (selectOption.item?.length === 0 && selectOption.child) || (selectOption.child && !selectOption.item)
|
const lazy = (selectOption.item?.length === 0 && selectOption.child) || (selectOption.child && !selectOption.item)
|
||||||
@ -938,7 +928,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
|
|||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
<sl-icon src="${img ?? nothing}"></sl-icon>
|
<et2-image src="${img ?? nothing}"></et2-image>
|
||||||
<span class="tree-item__label">
|
<span class="tree-item__label">
|
||||||
${selectOption.label ?? selectOption.text}
|
${selectOption.label ?? selectOption.text}
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user