Skip to content

Commit cb3d318

Browse files
khoroletsRomanHotsiy
authored andcommitted
Closes #322: Feature request: Clickable logo that points to specific url
1 parent 6b61d3a commit cb3d318

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/components/ApiLogo/api-logo.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
<img *ngIf="logo.imgUrl" [attr.src]="logo.imgUrl" [ngStyle]="{'background-color': logo.bgColor}">
1+
<a *ngIf="logo.url" href="{{logo.url}}">
2+
<img *ngIf="logo.imgUrl" [attr.src]="logo.imgUrl" [ngStyle]="{'background-color': logo.bgColor}">
3+
</a>
4+
<img *ngIf="logo.imgUrl && !logo.url" [attr.src]="logo.imgUrl" [ngStyle]="{'background-color': logo.bgColor}">

lib/components/ApiLogo/api-logo.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export class ApiLogo extends BaseComponent implements OnInit {
1717

1818
init() {
1919
let logoInfo = this.componentSchema.info['x-logo'];
20+
if ('url' in this.componentSchema.info['contact']) {
21+
this.logo.url = this.componentSchema.info['contact']['url'];
22+
}
2023
if (!logoInfo) return;
2124
this.logo.imgUrl = logoInfo.url;
2225
this.logo.bgColor = logoInfo.backgroundColor || 'transparent';

0 commit comments

Comments
 (0)