mobile-menu

master
Boris Voropaev 2023-09-28 16:16:52 +03:00
parent f4d2582bfb
commit 5b39a644ec
4 changed files with 10 additions and 12 deletions

View File

@ -34,7 +34,7 @@ export class PagesMenuItemComponent {
}
ngOnInit() {
this.showChildren = this.parentItem;
}
select(item:any){

View File

@ -1,9 +1,9 @@
<pages-menu-item
(click)="setHover(i,!hover[i])"
(mouseleave)="setHover(i,false)"
(mouseover)="setHover(i,true)"
(click)="setOpen(i,!open[i])"
(mouseleave)="setOpen(i,false)"
(mouseover)="setOpen(i,true)"
(onSelected)="itemSelect($event)"
[class.hover]="hover[i]"
[class.opened]="open[i]"
[class.depth]="getDepth(item)"
[item]="item" *ngFor="let item of visibleItems; let i=index;">
</pages-menu-item>

View File

@ -8,7 +8,7 @@ import {Component, EventEmitter, Input, Output} from '@angular/core';
export class PagesMenuComponent {
@Input() items = <any>[];
@Output() onSelected = new EventEmitter();
public hover:boolean[]=[]
public open:boolean[]=[]
private hiddenPages = ['/o-tsentre/protivodeistvie-korruptsii', '/o-tsentre/zashchita-personalnykh-dannykh', '/o-tsentre/okhrana-truda'];
@ -24,9 +24,9 @@ export class PagesMenuComponent {
this.onSelected.emit(event);
}
setHover(i:number,hover:boolean){
this.hover=[];
this.hover[i]=hover;
setOpen(i:number,open:boolean){
this.open=[];
this.open[i]=open;
}
getDepth(item){

View File

@ -60,8 +60,6 @@
}
}
}
@ -144,7 +142,7 @@
vertical-align: -6px;
margin-left: 4px;
}
&.hover {
&.opened{
>a::after{
transform: rotateZ(-90deg);
}