Skip to content

Commit

Permalink
fix(acordion): space beetween accordion groups (#2014)
Browse files Browse the repository at this point in the history
fixes #1854
  • Loading branch information
artemvfrolov authored and valorkin committed Jun 27, 2017
1 parent 31ee792 commit ad2da54
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class DemoAccordionDynamicComponent {

public status: any = {
isFirstOpen: true,
isOpen: false
isOpen: true
};

public groups: any[] = [
Expand Down
32 changes: 18 additions & 14 deletions src/accordion/accordion-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,26 @@ import { AccordionComponent } from './accordion.component';
@Component({
selector: 'accordion-group, accordion-panel',
template: `
<div class="panel card" [ngClass]="panelClass">
<div class="panel-heading card-header" role="tab" (click)="toggleOpen($event)">
<div class="panel-title">
<div role="button" class="accordion-toggle" [attr.aria-expanded]="isOpen">
<div *ngIf="heading"[ngClass]="{'text-muted': isDisabled}">{{heading}}</div>
<ng-content select="[accordion-heading]"></ng-content>
<div class="panel card" [ngClass]="panelClass">
<div class="panel-heading card-header" role="tab" (click)="toggleOpen($event)">
<div class="panel-title card-title">
<div role="button" class="accordion-toggle" [attr.aria-expanded]="isOpen">
<div *ngIf="heading"[ngClass]="{'text-muted': isDisabled}">{{heading}}</div>
<ng-content select="[accordion-heading]"></ng-content>
</div>
</div>
</div>
<div class="panel-collapse collapse" role="tabpanel" [collapse]="!isOpen">
<div class="panel-body card-block">
<ng-content></ng-content>
</div>
</div>
</div>
</div>
<div class="panel-collapse collapse" role="tabpanel" [collapse]="!isOpen">
<div class="panel-body card-block">
<ng-content></ng-content>
</div>
</div>
</div>
`
`,
host: {
class: 'panel',
style: 'display: block'
}
})
export class AccordionPanelComponent implements OnInit, OnDestroy {
/** Clickable text in accordion's group header, check `accordion heading` below for using html in header */
Expand Down
6 changes: 4 additions & 2 deletions src/accordion/accordion.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import { AccordionConfig } from './accordion.config';
template: `<ng-content></ng-content>`,
// tslint:disable-next-line
host: {
'[class.panel-group]': 'true',
//'[.class.panel-group]': 'true',
'[attr.aria-multiselectable]':'closeOthers',
role: 'tablist'
role: 'tablist',
class: 'panel-group',
style: 'display: block'
}
})
export class AccordionComponent {
Expand Down

0 comments on commit ad2da54

Please sign in to comment.