]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-main/buttons/edit-button.component.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / buttons / edit-button.component.ts
CommitLineData
30814423 1import { Component, Input, OnInit } from '@angular/core'
cd83ea1b
C
2
3@Component({
4 selector: 'my-edit-button',
5 styleUrls: [ './button.component.scss' ],
6 templateUrl: './edit-button.component.html'
7})
30814423 8export class EditButtonComponent implements OnInit {
eacb25c4 9 @Input() label: string
30814423 10 @Input() title: string
be27ef3b 11 @Input() routerLink: string[] | string = []
faf7eab7 12 @Input() responsiveLabel = false
30814423 13
30814423
K
14 ngOnInit () {
15 // <my-edit-button /> No label
16 if (this.label === undefined && !this.title) {
66357162 17 this.title = $localize`Update`
30814423
K
18 }
19
20 // <my-edit-button label /> Use default label
21 if (this.label === '') {
66357162 22 this.label = $localize`Update`
30814423
K
23
24 if (!this.title) {
25 this.title = this.label
26 }
27 }
28 }
cd83ea1b 29}