mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-30 12:33:43 +03:00
29 lines
655 B
JavaScript
29 lines
655 B
JavaScript
|
'use strict';
|
||
|
|
||
|
import {Component, View, EventEmitter, CORE_DIRECTIVES} from 'angular2/angular2';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'zippy',
|
||
|
events: ['open', 'close'],
|
||
|
inputs: ['title', 'visible', 'type', 'empty']
|
||
|
})
|
||
|
@View({
|
||
|
templateUrl: './lib/common/components/Zippy/zippy.html',
|
||
|
styleUrls: ['./lib/common/components/Zippy/zippy.css'],
|
||
|
directives: [CORE_DIRECTIVES]
|
||
|
})
|
||
|
export class Zippy {
|
||
|
|
||
|
constructor() {
|
||
|
this.type = 'general';
|
||
|
this.visible = false;
|
||
|
this.open = new EventEmitter();
|
||
|
this.close = new EventEmitter();
|
||
|
}
|
||
|
|
||
|
toggle() {
|
||
|
this.visible = !this.visible;
|
||
|
(this.visible) ? this.open.next() : this.close.next();
|
||
|
}
|
||
|
}
|