Skip to content

Commit 419073b

Browse files
Merge branch 'AlertModalComponent' of https://github.com/stanislavgeorgiev/carbon-components-angular into AlertModalComponent
2 parents c9c76fe + c8b926e commit 419073b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/dialog/overflow-menu/overflow-menu-option.component.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ import {
2323
<button
2424
class="bx--overflow-menu-options__btn"
2525
role="menuitem"
26-
[ngClass]="{
27-
'bx--overflow-menu-options__option--danger': type === 'danger',
28-
'bx--overflow-menu-options__option--disabled': disabled
29-
}"
26+
[disabled]="disabled"
3027
[tabindex]="(disabled ? -1 : null)"
3128
[title]="(titleEnabled ? content : '')">
3229
<ng-content></ng-content>
@@ -37,6 +34,15 @@ export class OverflowMenuOption {
3734
@HostBinding("class") optionClass = "bx--overflow-menu-options__option";
3835
@HostBinding("attr.role") role = "presentation";
3936

37+
@HostBinding("class.bx--overflow-menu-options__option--danger")
38+
public get isDanger(): Boolean {
39+
return this.type === "danger";
40+
}
41+
42+
@HostBinding("class.bx--overflow-menu-options__option--disabled")
43+
public get isDisabled(): Boolean {
44+
return this.disabled;
45+
}
4046
/**
4147
* toggles between `normal` and `danger` states
4248
*/

src/dialog/overflow-menu/overflow-menu-pane.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ export class OverflowMenuPane extends Dialog {
8181
}
8282

8383
private listItems() {
84-
const buttonClass = ".bx--overflow-menu-options__btn";
85-
const disabledClass = ".bx--overflow-menu-options__option--disabled";
86-
return Array.from<any>(this.dialog.nativeElement.querySelectorAll(`${buttonClass}:not(${disabledClass})`));
84+
return Array.from<any>(this.dialog.nativeElement.querySelectorAll(".bx--overflow-menu-options__btn:not([disabled])"));
8785
}
8886
}

src/i18n/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
"MODAL" : {
6969
"CLOSE": "Close modal"
7070
},
71+
"OVERFLOW_MENU" : {
72+
"OVERFLOW": "Overflow"
73+
},
7174
"SIDENAV": {
7275
"NAV_LABEL": "Side navigation"
7376
},

0 commit comments

Comments
 (0)