]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/buttons/edit-button.component.ts
Fix dropdowns z-index
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / buttons / edit-button.component.ts
index 9cfe1a3bbd062ae2665b9ed8a6d675589e6c3794..4b76551ca93c84b73aeafdf9669b7713fcd1eb60 100644 (file)
@@ -1,4 +1,4 @@
-import { Component, Input } from '@angular/core'
+import { Component, Input, OnInit } from '@angular/core'
 
 @Component({
   selector: 'my-edit-button',
@@ -6,7 +6,24 @@ import { Component, Input } from '@angular/core'
   templateUrl: './edit-button.component.html'
 })
 
-export class EditButtonComponent {
+export class EditButtonComponent implements OnInit {
   @Input() label: string
+  @Input() title: string
   @Input() routerLink: string[] | string = []
+
+  ngOnInit () {
+    // <my-edit-button /> No label
+    if (this.label === undefined && !this.title) {
+      this.title = $localize`Update`
+    }
+
+    // <my-edit-button label /> Use default label
+    if (this.label === '') {
+      this.label = $localize`Update`
+
+      if (!this.title) {
+        this.title = this.label
+      }
+    }
+  }
 }