File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,8 @@ import { I18n } from "carbon-components-angular/i18n";
17
17
(click)="doClick()"
18
18
[ngClass]="{'cds--header__action--active': active}"
19
19
class="cds--header__menu-trigger cds--header__action cds--header__menu-toggle"
20
- [attr.aria-label]="active
21
- ? (i18n.get('UI_SHELL.HEADER.CLOSE_MENU') | async)
22
- : (i18n.get('UI_SHELL.HEADER.OPEN_MENU') | async)"
23
- [attr.title]="active
24
- ? (i18n.get('UI_SHELL.HEADER.CLOSE_MENU') | async)
25
- : (i18n.get('UI_SHELL.HEADER.OPEN_MENU') | async)">
20
+ [attr.aria-label]="active ? activeTitle : inactiveTitle"
21
+ [attr.title]="active ? activeTitle : inactiveTitle">
26
22
<svg *ngIf="!active" cdsIcon="menu" size="20"></svg>
27
23
<svg *ngIf="active" cdsIcon="close" size="20"></svg>
28
24
</button>
@@ -34,12 +30,22 @@ export class Hamburger {
34
30
*/
35
31
@Input ( ) active = false ;
36
32
33
+ /**
34
+ * Set the title text when the hamburger is active
35
+ */
36
+ @Input ( ) activeTitle = this . i18n . get ( ) . UI_SHELL . HEADER . CLOSE_MENU ;
37
+
38
+ /**
39
+ * Set the title text when the hamburger is inactive
40
+ */
41
+ @Input ( ) inactiveTitle = this . i18n . get ( ) . UI_SHELL . HEADER . OPEN_MENU ;
42
+
37
43
/**
38
44
* `EventEmitter` to notify parent components of menu click events.
39
45
*/
40
46
@Output ( ) selected : EventEmitter < Object > = new EventEmitter < Object > ( ) ;
41
47
42
- constructor ( public i18n : I18n ) { }
48
+ constructor ( public i18n : I18n ) { }
43
49
44
50
/**
45
51
* Emit the Hamburger click event upwards.
You can’t perform that action at this time.
0 commit comments