File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 1- import { Component } from "@angular/core" ;
1+ import { Component , ElementRef } from "@angular/core" ;
22
33/**
44 * The OverFlow menu component encapsulates the OverFlowMenu directive, and the menu iconography into one convienent component
@@ -18,6 +18,7 @@ import { Component } from "@angular/core";
1818 <div
1919 [ibmOverflowMenu]="options"
2020 [appendToBody]="true"
21+ [ngClass]="{'bx--overflow-menu--open': open === true}"
2122 attr.aria-label="{{'OVERFLOW_MENU.OVERFLOW' | translate}}"
2223 class="bx--overflow-menu"
2324 role="button"
@@ -35,6 +36,20 @@ import { Component } from "@angular/core";
3536 <ng-template #options>
3637 <ng-content></ng-content>
3738 </ng-template>
38- `
39+ ` ,
40+ styles : [ `
41+ .bx--overflow-menu--open {
42+ opacity: 1
43+ }
44+ ` ]
3945} )
40- export class OverflowMenu { }
46+ export class OverflowMenu {
47+ constructor ( private elementRef : ElementRef ) { }
48+
49+ get open ( ) {
50+ if ( this . elementRef . nativeElement . children [ 0 ] . getAttribute ( "aria-expanded" ) === "true" ) {
51+ return true ;
52+ }
53+ return false ;
54+ }
55+ }
You can’t perform that action at this time.
0 commit comments