mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 05:20:32 +03:00
Zippy minor update
This commit is contained in:
parent
68286279f7
commit
b275d5af65
|
@ -13,17 +13,19 @@ import {CORE_DIRECTIVES} from 'angular2/common';
|
||||||
styleUrls: ['./lib/common/components/Zippy/zippy.css'],
|
styleUrls: ['./lib/common/components/Zippy/zippy.css'],
|
||||||
directives: [CORE_DIRECTIVES]
|
directives: [CORE_DIRECTIVES]
|
||||||
})
|
})
|
||||||
export class Zippy {
|
export default class Zippy {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.type = 'general';
|
this.type = 'general';
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
this.empty = false;
|
||||||
this.open = new EventEmitter();
|
this.open = new EventEmitter();
|
||||||
this.close = new EventEmitter();
|
this.close = new EventEmitter();
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
this.visible = !this.visible;
|
this.visible = !this.visible;
|
||||||
|
if (this.empty) return;
|
||||||
(this.visible) ? this.open.next() : this.close.next();
|
(this.visible) ? this.open.next() : this.close.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {RedocComponent, BaseComponent} from '../base';
|
import {RedocComponent, BaseComponent} from '../base';
|
||||||
import JsonPointer from '../../utils/JsonPointer';
|
import JsonPointer from '../../utils/JsonPointer';
|
||||||
import JsonSchema from '../JsonSchema/json-schema';
|
import JsonSchema from '../JsonSchema/json-schema';
|
||||||
import {Zippy} from '../../common/components/Zippy/zippy';
|
import Zippy from '../../common/components/Zippy/zippy';
|
||||||
import {statusCodeType} from '../../utils/helpers';
|
import {statusCodeType} from '../../utils/helpers';
|
||||||
|
|
||||||
function isNumeric(n) {
|
function isNumeric(n) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user