migration
parent
1be628ef2b
commit
2b010cf017
|
|
@ -1,7 +1,4 @@
|
|||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import {AdvisoryMembersService} from "@app/_services/advisory-members.service";
|
||||
import {ListsService} from "@app/_services";
|
||||
import {Subscription} from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: 'pages-menu',
|
||||
|
|
@ -11,15 +8,14 @@ import {Subscription} from "rxjs";
|
|||
export class PagesMenuComponent {
|
||||
@Input() items = <any>[];
|
||||
@Output() onSelected = new EventEmitter();
|
||||
public hidden = false;
|
||||
public hover:boolean[]=[]
|
||||
|
||||
private hiddenPages = ['/o-tsentre/protivodeistvie-korruptsii', '/o-tsentre/zashchita-personalnykh-dannykh', '/o-tsentre/okhrana-truda'];
|
||||
|
||||
// ngOnInit(){
|
||||
// console.log(this.items)
|
||||
// }
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
get visibleItems() {
|
||||
|
|
@ -28,16 +24,21 @@ export class PagesMenuComponent {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
this.hidden = !this.hidden;
|
||||
}
|
||||
|
||||
leave(){
|
||||
this.hidden = false;
|
||||
}
|
||||
|
||||
itemSelect(event:any){
|
||||
this.onSelected.emit(event);
|
||||
}
|
||||
}
|
||||
|
||||
setHover(i:number,hover:boolean){
|
||||
this.hover=[];
|
||||
this.hover[i]=hover;
|
||||
}
|
||||
|
||||
getDepth(item){
|
||||
if (!item.hasOwnProperty('depth')) item.depth=0;
|
||||
if (item.children?.data.length) item.depth = 1;
|
||||
item.children?.data.forEach(child => {
|
||||
if (this.getDepth(child)>=item.depth) item.depth++;
|
||||
});
|
||||
return item.depth
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue