diff --git a/demo/src/app/components/accordion/demos/accordion-demo.component.html b/demo/src/app/components/accordion/demos/accordion-demo.component.html index 6452db2b3e..37aa3a2933 100644 --- a/demo/src/app/components/accordion/demos/accordion-demo.component.html +++ b/demo/src/app/components/accordion/demos/accordion-demo.component.html @@ -3,7 +3,8 @@ (click)="group.isOpen = !group.isOpen">Toggle last panel
@@ -21,18 +22,20 @@ This content is straight in the template.The body of the accordion group grows to fit the contents
- +true
— disables accordion group */
- @Input() public isDisabled:boolean;
+ @Input() public isDisabled: boolean;
// Questionable, maybe .panel-open should be on child div.panel element?
/** Is accordion group open or closed */
@HostBinding('class.panel-open')
@Input()
- public get isOpen():boolean {
+ public get isOpen(): boolean {
return this._isOpen;
}
- public set isOpen(value:boolean) {
+ public set isOpen(value: boolean) {
this._isOpen = value;
if (value) {
this.accordion.closeOtherPanels(this);
}
}
- protected _isOpen:boolean;
- protected accordion:AccordionComponent;
+ public get isBs3(): boolean {
+ return isBs3();
+ }
+
+ protected _isOpen: boolean;
+ protected accordion: AccordionComponent;
- public constructor(@Inject(AccordionComponent) accordion:AccordionComponent) {
+ public constructor(@Inject(AccordionComponent) accordion: AccordionComponent) {
this.accordion = accordion;
}
- public ngOnInit():any {
+ public ngOnInit(): any {
this.panelClass = this.panelClass || 'panel-default';
this.accordion.addGroup(this);
}
- public ngOnDestroy():any {
+ public ngOnDestroy(): any {
this.accordion.removeGroup(this);
}
- public toggleOpen(event:Event):any {
+ public toggleOpen(event: Event): any {
event.preventDefault();
if (!this.isDisabled) {
this.isOpen = !this.isOpen;
diff --git a/src/accordion/accordion.component.ts b/src/accordion/accordion.component.ts
index cab03ab2e2..c4f6e4845f 100644
--- a/src/accordion/accordion.component.ts
+++ b/src/accordion/accordion.component.ts
@@ -7,7 +7,11 @@ import { AccordionConfig } from './accordion.config';
selector: 'accordion',
template: `