X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fangular%2Flink.component.ts;h=f2093496fdf375fb0d9f148c40f4d885164c4fc0;hb=4b70c278a960a8d43407f0039aa03d0b08b44f9c;hp=597a16871f5de71e484280c8473b046a94a93cb9;hpb=cf21b2cbef61929177b9c09b5e017c3b7eb8535d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/angular/link.component.ts b/client/src/app/shared/shared-main/angular/link.component.ts index 597a16871..f2093496f 100644 --- a/client/src/app/shared/shared-main/angular/link.component.ts +++ b/client/src/app/shared/shared-main/angular/link.component.ts @@ -1,17 +1,30 @@ -import { Component, Input, ViewEncapsulation } from '@angular/core' +import { Component, Input, OnInit } from '@angular/core' @Component({ selector: 'my-link', styleUrls: [ './link.component.scss' ], templateUrl: './link.component.html' }) -export class LinkComponent { +export class LinkComponent implements OnInit { @Input() internalLink?: string | any[] @Input() href?: string - @Input() target?: string + @Input() target = '_self' @Input() title?: string + @Input() className?: string + @Input() inheritParentCSS = false + @Input() tabindex: string | number + + builtClasses: string + + ngOnInit () { + this.builtClasses = this.className || '' + + if (!this.builtClasses || this.inheritParentCSS) { + this.builtClasses += ' inherit-parent' + } + } }