Commit 2e759b82 authored by naji's avatar naji
Browse files

fix: navigation metadata panneau lateral

parent dec2e088
......@@ -33,14 +33,14 @@
<!--Root children with children-->
<span *ngIf="node.children.length && node.name !== rootElementName
&& isPartOfCollection(node) && shouldBeOnTab(node) && !isAttribute(node)"
(click)="updateMedataTable(node);$event.stopPropagation()">
<div [ngStyle]="{'margin-left': calculateNodePosition(node) + 'px' , 'width': '350px' }" (click)="showChildren(node);$event.stopPropagation()">
<button [id]="'showChild' + node.name" *ngIf="isElementComplexAndHasChildren(node)"
mat-icon-button matTreeNodeToggle
class="pastis-chevron-icon"
(click)="updateMedataTable(node);$event.stopPropagation()">
&& isPartOfCollection(node) && shouldBeOnTab(node) && !isAttribute(node)">
<div [ngStyle]="{'margin-left': calculateNodePosition(node) + 'px' , 'width': '350px' }" (click)="expendChildren(node);$event.stopPropagation()">
<span *ngIf="isElementComplexAndHasChildren(node)"
[ngClass]="{'pastis-chevron-icon': !fileTreeService.nestedTreeControl.isExpanded(node),'pastis-chevron-icon-selected':fileTreeService.nestedTreeControl.isExpanded(node)}">
<mat-icon>{{fileTreeService.nestedTreeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}</mat-icon>
</span>
<button [id]="'child' + node.id" mat-icon-button matTreeNodeToggle
[ngStyle]="{'display': 'none' }">
</button>
<span class="pastis-tree-node-name">
<span class="text text-medium"
......
......@@ -110,9 +110,10 @@
}
.pastis-chevron-icon{
text-align-last:left;
margin-right: 10px;
}
.pastis-chevron-icon:focus{
.pastis-chevron-icon-selected{
@extend .pastis-chevron-icon;
color: var(--vitamui-primary);
}
......
......@@ -124,6 +124,7 @@ export class FileTreeComponent implements OnDestroy {
selectedItemList: FileNode;
sedaLanguage: boolean;
sedaLanguageSub: Subscription;
viewChild: FileNode[]=[];
notificationRemoveSuccessOne: string;
notificationRemoveSuccessTwo: string;
......@@ -733,11 +734,40 @@ export class FileTreeComponent implements OnDestroy {
}
return false;
}
showChildren(node: FileNode){
this.updateMedataTable(node);
document.getElementById("showChild"+ node.name).click();
expendChildren(node: FileNode){
if(this.fileTreeService.nestedTreeControl.isExpanded(node)){
this.filterExpandedChildren(node, true);
}
else{
document.getElementById("child"+ node.id).click();
this.filterExpandedChildren(node, false);
this.viewChild.push(node)
this.updateMedataTable(node);
}
}
filterExpandedChildren(node: FileNode, isExpanded: boolean){
if(this.viewChild && this.viewChild.length>0){
this.viewChild.forEach((e: FileNode) => {
const abstractFunctionCondition: Function = (isExpanded: boolean): boolean => {
return isExpanded ? (e.id != node.id && e.level >= node.level) :
e.id != node.id &&
(e.level === node.level || (e.level > node.level && e.parentId != node.parentId));
};
if(abstractFunctionCondition(isExpanded)){
if(this.fileTreeService.nestedTreeControl.isExpanded(e)){
document.getElementById("child"+ e.id).click();
}
this.viewChild = isExpanded ? this.viewChild.filter(e => e.id === node.id) :
this.viewChild.filter(e => e.id !== node.id);
}
})
if(isExpanded){
this.updateMedataTable(node);
}
}
}
ngOnDestroy(){
if(this.sedaLanguageSub != null){
this.sedaLanguageSub.unsubscribe();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment