From b275d5af654e3fedf6d33c4c4fabc94f543c6c33 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sat, 19 Dec 2015 14:16:17 +0200 Subject: [PATCH] Zippy minor update --- lib/common/components/Zippy/zippy.js | 4 +++- lib/components/ResponsesList/responses-list.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/common/components/Zippy/zippy.js b/lib/common/components/Zippy/zippy.js index 90ab8501..9828d0c6 100644 --- a/lib/common/components/Zippy/zippy.js +++ b/lib/common/components/Zippy/zippy.js @@ -13,17 +13,19 @@ import {CORE_DIRECTIVES} from 'angular2/common'; styleUrls: ['./lib/common/components/Zippy/zippy.css'], directives: [CORE_DIRECTIVES] }) -export class Zippy { +export default class Zippy { constructor() { this.type = 'general'; this.visible = false; + this.empty = false; this.open = new EventEmitter(); this.close = new EventEmitter(); } toggle() { this.visible = !this.visible; + if (this.empty) return; (this.visible) ? this.open.next() : this.close.next(); } } diff --git a/lib/components/ResponsesList/responses-list.js b/lib/components/ResponsesList/responses-list.js index 2dc647e0..84d1e632 100644 --- a/lib/components/ResponsesList/responses-list.js +++ b/lib/components/ResponsesList/responses-list.js @@ -3,7 +3,7 @@ import {RedocComponent, BaseComponent} from '../base'; import JsonPointer from '../../utils/JsonPointer'; 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'; function isNumeric(n) {