redoc/lib/components/ApiLogo/api-logo.ts

24 lines
542 B
TypeScript
Raw Normal View History

'use strict';
import {RedocComponent, BaseComponent, SchemaManager} from '../base';
@RedocComponent({
selector: 'api-logo',
styleUrls: ['./api-logo.css'],
templateUrl: './api-logo.html'
})
2016-05-06 00:48:41 +03:00
export class ApiLogo extends BaseComponent {
data:any = {};
constructor(schemaMgr:SchemaManager) {
super(schemaMgr);
}
prepareModel() {
let logoInfo = this.componentSchema.info['x-logo'];
if (!logoInfo) return;
this.data.imgUrl = logoInfo.url;
this.data.bgColor = logoInfo.backgroundColor || 'transparent';
}
}