Skip to content

Commit

Permalink
feat(module:collapse) update collapse animations (NG-ZORRO#881)
Browse files Browse the repository at this point in the history
close issues NG-ZORRO#862
  • Loading branch information
chensimeng authored and vthinkxie committed Jan 16, 2018
1 parent 0679b33 commit ff34784
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/collapse/nz-collapse.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { toBoolean } from '../util/convert';
import { NzCollapsesetComponent } from './nz-collapseset.component';

@Component({
selector : 'nz-collapse',
template : `
selector : 'nz-collapse',
template : `
<div class="ant-collapse-header" [attr.aria-expanded]="_active" (click)="clickHeader($event)" role="tab">
<i class="arrow"></i>
<ng-template [ngIf]="nzTitle">
Expand All @@ -27,13 +27,13 @@ import { NzCollapsesetComponent } from './nz-collapseset.component';
<ng-content select="[collapse-title]"></ng-content>
</ng-template>
</div>
<div class="ant-collapse-content" [@collapseState]="_active?'active':'inactive'">
<div [ngClass]="{'ant-collapse-content':true,'ant-collapse-content-status-active':_active,'ant-collapse-contents-status-inactive':!_active}" [@collapseState]="_active?'active':'inactive'">
<div class="ant-collapse-content-box">
<ng-content></ng-content>
</div>
</div>
`,
animations : [
animations: [
trigger('collapseState', [
state('inactive', style({
opacity: '0',
Expand All @@ -47,17 +47,15 @@ import { NzCollapsesetComponent } from './nz-collapseset.component';
transition('active => inactive', animate('150ms ease-out'))
])
],
host: {
host : {
'[class.ant-collapse-item]': 'true'
}
})

export class NzCollapseComponent {
private _disabled = false;
_active = false;

_el;

@Input() nzTitle: string;

@Input()
Expand Down

0 comments on commit ff34784

Please sign in to comment.