diff --git a/lib/components/SideMenu/side-menu.html b/lib/components/SideMenu/side-menu.html index a947fcc1..c0929bf8 100644 --- a/lib/components/SideMenu/side-menu.html +++ b/lib/components/SideMenu/side-menu.html @@ -10,7 +10,7 @@ -
- +
+
+ +
diff --git a/lib/shared/components/Zippy/zippy.scss b/lib/shared/components/Zippy/zippy.scss index 516a95db..05087ed3 100644 --- a/lib/shared/components/Zippy/zippy.scss +++ b/lib/shared/components/Zippy/zippy.scss @@ -47,6 +47,10 @@ span.zippy-indicator { } .zippy-content { + overflow: hidden; +} + +.zippy-content-wrap { padding: 15px 0; } diff --git a/lib/shared/components/Zippy/zippy.ts b/lib/shared/components/Zippy/zippy.ts index f23ccc1f..7ffa180b 100644 --- a/lib/shared/components/Zippy/zippy.ts +++ b/lib/shared/components/Zippy/zippy.ts @@ -1,13 +1,25 @@ 'use strict'; -import { Component, EventEmitter, Output, Input } from '@angular/core'; +import { Component, EventEmitter, Output, Input, + trigger, state, animate, transition, style } from '@angular/core'; import { CORE_DIRECTIVES } from '@angular/common'; @Component({ selector: 'zippy', templateUrl: './zippy.html', styleUrls: ['./zippy.css'], - directives: [CORE_DIRECTIVES] + directives: [CORE_DIRECTIVES], + animations: [ + trigger('openClose', [ + state('collapsed, void', + style({ height: '0px' })), + state('expanded', + style({ height: '*' })), + transition('collapsed <=> expanded', [ + animate(200) + ]) + ]) + ], }) export class Zippy { @Input() type = 'general'; @@ -16,10 +28,13 @@ export class Zippy { @Input() title; @Output() open = new EventEmitter(); @Output() close = new EventEmitter(); - toggle() { this.visible = !this.visible; if (this.empty) return; - (this.visible) ? this.open.next({}) : this.close.next({}); + if (this.visible) { + this.open.next({}); + } else { + this.close.next({}); + } } }