diff --git a/src/app/shared/system-component/filetreeview/filetreeview.component.html b/src/app/shared/system-component/filetreeview/filetreeview.component.html index 35edd5d4..34484cd5 100644 --- a/src/app/shared/system-component/filetreeview/filetreeview.component.html +++ b/src/app/shared/system-component/filetreeview/filetreeview.component.html @@ -24,11 +24,11 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/shared/system-component/filetreeview/filetreeview.component.ts b/src/app/shared/system-component/filetreeview/filetreeview.component.ts index 26518b01..3d95108b 100644 --- a/src/app/shared/system-component/filetreeview/filetreeview.component.ts +++ b/src/app/shared/system-component/filetreeview/filetreeview.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FileTreeNode } from 'src/app/system-files/file.tree.node'; @Component({ @@ -9,16 +9,50 @@ import { FileTreeNode } from 'src/app/system-files/file.tree.node'; export class FileTreeViewComponent implements OnInit { @Input() treeData: FileTreeNode[] = []; @Input() pid = 0; + @Output() getDataEvent = new EventEmitter(); chevronBtnStyle:Record = {}; + constructor( ){ + // + } + ngOnInit():void{ this.setcolorChevron(); } - showChildren(id?:number, id1?:number):void{ + showChildren(name?:string):void{ + + let ulId = ''; let imgId = '' + + ulId = `fileExplrTreeView-${this.pid}`; + imgId = `fileExplrTreeView-img-${this.pid}`; + + console.log('passed id:', ulId); + console.log('passed imgId:', imgId); + console.log('passed name:', name); + + const toggler = document.getElementById(ulId) as HTMLElement; + const imgDiv = document.getElementById(imgId) as HTMLElement; + + if(toggler){ + console.log('toggler:', toggler); + toggler.parentElement?.querySelector(".nested")?.classList.toggle("active"); + + if(imgDiv){ + console.log('imgDiv:', imgDiv); + imgDiv.style.transform = 'rotate(90deg)'; + imgDiv.style.position = 'relative'; + } + + //pass event to the parent + //this.getDataEvent.emit(name); + } + } + + showGrandChildren(id?:number, id1?:number, name?:string):void{ let ulId = ''; let imgId = '' @@ -43,6 +77,52 @@ export class FileTreeViewComponent implements OnInit { if(toggler){ console.log('toggler:', toggler); toggler.parentElement?.querySelector(".nested")?.classList.toggle("active"); + + + //toggler.classList.remove("nested"); + //toggler.classList.remove("active"); + //toggler.classList.toggle("caret-down"); + + if(imgDiv){ + console.log('imgDiv:', imgDiv); + imgDiv.style.transform = 'rotate(90deg)'; + imgDiv.style.position = 'relative'; + } + + //pass event to the parent + //this.getDataEvent.emit(name); + } + } + + + showGreatGrandChildren(id?:number, id1?:number, name?:string):void{ + + let ulId = ''; let imgId = '' + + if(id === undefined && id1 === undefined ){ + ulId = `fileExplrTreeView-${this.pid}`; + imgId = `fileExplrTreeView-img-${this.pid}`; + } + + if(id !== undefined && id1 === undefined ) + ulId = `fileExplrTreeView-${this.pid}-${id}`; + + if(id !== undefined && id1 !== undefined ) + ulId = `fileExplrTreeView-${this.pid}-${id}-${id1}`; + + console.log('passed id:', ulId); + console.log('passed imgId:', imgId); + + const toggler = document.getElementById(ulId) as HTMLElement; + const imgDiv = document.getElementById(imgId) as HTMLElement; + + if(toggler){ + console.log('toggler:', toggler); + toggler.parentElement?.querySelector(".nested")?.classList.toggle("active"); + + + //toggler.classList.remove("nested"); + //toggler.classList.remove("active"); //toggler.classList.toggle("caret-down"); if(imgDiv){ @@ -50,9 +130,14 @@ export class FileTreeViewComponent implements OnInit { imgDiv.style.transform = 'rotate(90deg)'; imgDiv.style.position = 'relative'; } + + //pass event to the parent + //this.getDataEvent.emit(name); } } + + showCurrentSelection():void{ 1 } @@ -64,15 +149,45 @@ export class FileTreeViewComponent implements OnInit { } } - colorChevron():void{ - this.chevronBtnStyle ={ - 'fill': 'rgb(18, 107, 240)' + colorChevron(id?:number, id1?:number):void{ + let imgId = '' + + if(id === undefined && id1 === undefined ){ + imgId = `fileExplrTreeView-img-${this.pid}`; + } + + if(id !== undefined && id1 === undefined ) + imgId = `fileExplrTreeView-img-${this.pid}-${id}`; + + if(id !== undefined && id1 !== undefined ) + imgId = `fileExplrTreeView-img-${this.pid}-${id}-${id1}`; + + const imgDiv = document.getElementById(imgId) as HTMLElement; + + if(imgDiv){ + console.log('unColorChevron-imgDiv:', imgDiv); + imgDiv.style.fill = 'rgb(18, 107, 240)'; } } - unColorChevron():void{ - this.chevronBtnStyle ={ - 'fill': '#ccc' + unColorChevron(id?:number, id1?:number):void{ + let imgId = '' + + if(id === undefined && id1 === undefined ){ + imgId = `fileExplrTreeView-img-${this.pid}`; + } + + if(id !== undefined && id1 === undefined ) + imgId = `fileExplrTreeView-img-${this.pid}-${id}`; + + if(id !== undefined && id1 !== undefined ) + imgId = `fileExplrTreeView-img-${this.pid}-${id}-${id1}`; + + const imgDiv = document.getElementById(imgId) as HTMLElement; + + if(imgDiv){ + console.log('unColorChevron-imgDiv:', imgDiv); + imgDiv.style.fill = '#ccc'; } } diff --git a/src/app/system-apps/taskbarentry/taskbarentry.component.html b/src/app/system-apps/taskbarentry/taskbarentry.component.html index 189e8174..59bf67fc 100644 --- a/src/app/system-apps/taskbarentry/taskbarentry.component.html +++ b/src/app/system-apps/taskbarentry/taskbarentry.component.html @@ -1,5 +1,5 @@
  • -
    +