Skip to content

Commit

Permalink
fix(accordion|tabs): fix cursor style when disabled element (#4664)
Browse files Browse the repository at this point in the history
fix(accordion|tabs): fix cursor style when disabled element
  • Loading branch information
tarusin authored and Domainv committed Jun 21, 2019
1 parent 27639ea commit 42cc778
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/accordion/accordion-group.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class="panel card" [ngClass]="panelClass">
<div class="panel-heading card-header" role="tab"
(click)="toggleOpen()">
(click)="toggleOpen()"
[ngClass]="isDisabled ? 'panel-disabled' : 'panel-enabled'">

<div class="panel-title">
<div role="button" class="accordion-toggle"
[attr.aria-expanded]="isOpen">
Expand Down
3 changes: 2 additions & 1 deletion src/accordion/accordion-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { AccordionComponent } from './accordion.component';
host: {
class: 'panel',
style: 'display: block'
}
},
styleUrls: ['./accordion.scss']
})
export class AccordionPanelComponent implements OnInit, OnDestroy {
/** turn on/off animation */
Expand Down
15 changes: 15 additions & 0 deletions src/accordion/accordion.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:host {
.card-header {
&.panel-enabled {
cursor: pointer;
}
&.panel-disabled {
.btn {
&.btn-link {
cursor: default;
text-decoration: none;
}
}
}
}
}
13 changes: 13 additions & 0 deletions src/tabs/tabs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:host {
.nav-tabs {
.nav-item {
&.disabled {
a {
&.disabled {
cursor: default;
}
}
}
}
}
}
3 changes: 2 additions & 1 deletion src/tabs/tabset.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { TabsetConfig } from './tabset.config';
// todo: fix? mixing static and dynamic tabs position tabs in order of creation
@Component({
selector: 'tabset',
templateUrl: './tabset.component.html'
templateUrl: './tabset.component.html',
styleUrls: ['./tabs.scss']
})
export class TabsetComponent implements OnDestroy {
/** if true tabs will be placed vertically */
Expand Down

0 comments on commit 42cc778

Please sign in to comment.