Skip to content

Commit

Permalink
revert tree processedNodeStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Jul 11, 2024
1 parent 27e031d commit 154d30f
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ import {
<li
*ngIf="!tree.horizontal"
[ngClass]="['p-treenode', node.styleClass || '', isLeaf() ? 'p-treenode-leaf' : '']"
[ngStyle]="getProcessedNodeStyle(node)"
[ngStyle]="{ height: itemSize + 'px' }"
[style]="node.style"
[attr.aria-label]="node.label"
[attr.aria-checked]="ariaChecked"
[attr.aria-setsize]="node.children ? node.children.length : 0"
Expand Down Expand Up @@ -274,29 +275,6 @@ export class UITreeNode implements OnInit {
return this.tree.selectionMode === 'checkbox' ? this.isSelected() : undefined;
}

getProcessedNodeStyle(node: any) {
const processedStyle: any = {
'height': this.itemSize + 'px' ,
};

if (node.style && typeof node.style === 'string') {
const styleParts = node.style.trim().split(';');
styleParts.forEach(part => {
const trimmedPart = part.trim();
if (trimmedPart) {
const [key, value] = trimmedPart.split(':');
if (key && value) {
processedStyle[key.trim()] = value.trim();
}
}
});
} else if (typeof node.style === 'object') {
Object.assign(processedStyle, node.style);
}

return processedStyle;
}

constructor(@Inject(forwardRef(() => Tree)) tree: Tree) {
this.tree = tree as Tree;
}
Expand Down

0 comments on commit 154d30f

Please sign in to comment.