mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
Closes #322: Feature request: Clickable logo that points to specific url
This commit is contained in:
parent
6b61d3aee1
commit
cb3d318e4a
|
@ -1 +1,4 @@
|
||||||
|
<a *ngIf="logo.url" href="{{logo.url}}">
|
||||||
<img *ngIf="logo.imgUrl" [attr.src]="logo.imgUrl" [ngStyle]="{'background-color': logo.bgColor}">
|
<img *ngIf="logo.imgUrl" [attr.src]="logo.imgUrl" [ngStyle]="{'background-color': logo.bgColor}">
|
||||||
|
</a>
|
||||||
|
<img *ngIf="logo.imgUrl && !logo.url" [attr.src]="logo.imgUrl" [ngStyle]="{'background-color': logo.bgColor}">
|
||||||
|
|
|
@ -17,6 +17,9 @@ export class ApiLogo extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
let logoInfo = this.componentSchema.info['x-logo'];
|
let logoInfo = this.componentSchema.info['x-logo'];
|
||||||
|
if ('url' in this.componentSchema.info['contact']) {
|
||||||
|
this.logo.url = this.componentSchema.info['contact']['url'];
|
||||||
|
}
|
||||||
if (!logoInfo) return;
|
if (!logoInfo) return;
|
||||||
this.logo.imgUrl = logoInfo.url;
|
this.logo.imgUrl = logoInfo.url;
|
||||||
this.logo.bgColor = logoInfo.backgroundColor || 'transparent';
|
this.logo.bgColor = logoInfo.backgroundColor || 'transparent';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user