aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/buttons/delete-button.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-main/buttons/delete-button.component.ts')
-rw-r--r--client/src/app/shared/shared-main/buttons/delete-button.component.ts17
1 files changed, 14 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-main/buttons/delete-button.component.ts b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
index 39e31900f..aced0f881 100644
--- a/client/src/app/shared/shared-main/buttons/delete-button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
@@ -9,12 +9,23 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
9 9
10export class DeleteButtonComponent implements OnInit { 10export class DeleteButtonComponent implements OnInit {
11 @Input() label: string 11 @Input() label: string
12 12 @Input() title: string
13 title: string
14 13
15 constructor (private i18n: I18n) { } 14 constructor (private i18n: I18n) { }
16 15
17 ngOnInit () { 16 ngOnInit () {
18 this.title = this.label || this.i18n('Delete') 17 // <my-delete-button /> No label
18 if (this.label === undefined && !this.title) {
19 this.title = this.i18n('Delete')
20 }
21
22 // <my-delete-button label /> Use default label
23 if (this.label === '') {
24 this.label = this.i18n('Delete')
25
26 if (!this.title) {
27 this.title = this.label
28 }
29 }
19 } 30 }
20} 31}