File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
src/Umbraco.Web.UI.Client/src/packages
core/tree/tree-item/tree-item-base
documents/documents/tree/tree-item
media/media/tree/tree-item Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export abstract class UmbTreeItemElementBase<TreeItemModelType extends UmbTreeIt
2020 hideActions : boolean = false ;
2121
2222 @state ( )
23- private _isActive = false ;
23+ protected _isActive = false ;
2424
2525 @state ( )
2626 private _childItems ?: TreeItemModelType [ ] ;
@@ -150,9 +150,10 @@ export abstract class UmbTreeItemElementBase<TreeItemModelType extends UmbTreeIt
150150 #renderIcon( ) {
151151 const icon = this . _item ?. icon ;
152152 const isFolder = this . _item ?. isFolder ;
153+ const iconWithoutColor = icon ?. split ( ' ' ) [ 0 ] ;
153154
154- if ( icon ) {
155- return html `< umb-icon slot ="icon " name ="${ icon } "> </ umb-icon > ` ;
155+ if ( icon && iconWithoutColor ) {
156+ return html `< umb-icon slot ="icon " name ="${ this . _isActive ? iconWithoutColor : icon } "> </ umb-icon > ` ;
156157 }
157158
158159 if ( isFolder ) {
Original file line number Diff line number Diff line change @@ -76,11 +76,14 @@ export class UmbDocumentTreeItemElement extends UmbTreeItemElementBase<UmbDocume
7676 }
7777
7878 override renderIconContainer ( ) {
79+ const icon = this . item ?. documentType . icon ;
80+ const iconWithoutColor = icon ?. split ( ' ' ) [ 0 ] ;
81+
7982 return html `
8083 <span id= "icon-container" slot = "icon" class = ${ classMap ( { draft : this . #isDraft( ) } ) } >
81- ${ this . item ?. documentType . icon
84+ ${ icon && iconWithoutColor
8285 ? html `
83- <umb- icon id= "icon" slot = "icon" name = "${ this . item . documentType . icon } " > </ umb- icon>
86+ <umb- icon id= "icon" slot = "icon" name = "${ this . _isActive ? iconWithoutColor : icon } " > </ umb- icon>
8487 ${ this . #renderStateIcon( ) }
8588 `
8689 : nothing }
Original file line number Diff line number Diff line change @@ -7,11 +7,14 @@ const elementName = 'umb-media-tree-item';
77@customElement ( elementName )
88export class UmbMediaTreeItemElement extends UmbTreeItemElementBase < UmbMediaTreeItemModel > {
99 override renderIconContainer ( ) {
10+ const icon = this . item ?. mediaType . icon ;
11+ const iconWithoutColor = icon ?. split ( ' ' ) [ 0 ] ;
12+
1013 return html `
1114 <span id= "icon-container" slot = "icon" >
12- ${ this . item ?. mediaType . icon
15+ ${ icon && iconWithoutColor
1316 ? html `
14- <umb- icon id= "icon" slot = "icon" name = "${ this . item . mediaType . icon } " > </ umb- icon>
17+ <umb- icon id= "icon" slot = "icon" name = "${ this . _isActive ? iconWithoutColor : icon } " > </ umb- icon>
1518 ${ this . #renderStateIcon( ) }
1619 `
1720 : nothing }
You can’t perform that action at this time.
0 commit comments