File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ root = true
4
4
[* ]
5
5
charset = utf-8
6
6
indent_style = space
7
- indent_size = 2
7
+ indent_size = 4
8
8
insert_final_newline = true
9
9
trim_trailing_whitespace = true
10
10
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ export class MenubarSub implements OnDestroy {
56
56
activeItem : any ;
57
57
58
58
hideTimeout : any ;
59
+
60
+ activeMenu : any ;
59
61
60
62
constructor ( public domHandler : DomHandler , public renderer : Renderer2 ) { }
61
63
@@ -65,8 +67,8 @@ export class MenubarSub implements OnDestroy {
65
67
if ( menuitem . disabled ) {
66
68
return ;
67
69
}
68
-
69
- this . activeItem = item ;
70
+
71
+ this . activeItem = this . activeMenu ? ( this . activeMenu . isEqualNode ( item ) ? null : item ) : item ;
70
72
let nextElement = < HTMLLIElement > item . children [ 0 ] . nextElementSibling ;
71
73
if ( nextElement ) {
72
74
let sublist = < HTMLUListElement > nextElement . children [ 0 ] ;
@@ -85,7 +87,8 @@ export class MenubarSub implements OnDestroy {
85
87
}
86
88
87
89
this . menuClick = true ;
88
- this . menuHoverActive = true ;
90
+ this . menuHoverActive = this . activeMenu ? ( ! this . activeMenu . isEqualNode ( item ) ) : true ;
91
+ this . activeMenu = this . activeMenu ? ( this . activeMenu . isEqualNode ( item ) ? null : item ) : item ;
89
92
this . bindEventListener ( ) ;
90
93
}
91
94
}
@@ -128,6 +131,8 @@ export class MenubarSub implements OnDestroy {
128
131
sublist . style . left = this . domHandler . getOuterWidth ( item . children [ 0 ] ) + 'px' ;
129
132
}
130
133
}
134
+
135
+ this . activeMenu = this . activeMenu ? ( this . activeMenu . isEqualNode ( item ) ? null : item ) : item ;
131
136
}
132
137
}
133
138
You can’t perform that action at this time.
0 commit comments