diff options
Diffstat (limited to 'client/src/app/shared/shared-main/buttons/button.component.ts')
-rw-r--r-- | client/src/app/shared/shared-main/buttons/button.component.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts index 52936a4d4..10d67831f 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.ts +++ b/client/src/app/shared/shared-main/buttons/button.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input, OnChanges } from '@angular/core' |
2 | import { GlobalIconName } from '@app/shared/shared-icons' | 2 | import { GlobalIconName } from '@app/shared/shared-icons' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
@@ -7,20 +7,24 @@ import { GlobalIconName } from '@app/shared/shared-icons' | |||
7 | templateUrl: './button.component.html' | 7 | templateUrl: './button.component.html' |
8 | }) | 8 | }) |
9 | 9 | ||
10 | export class ButtonComponent { | 10 | export class ButtonComponent implements OnChanges { |
11 | @Input() label = '' | 11 | @Input() label = '' |
12 | @Input() className = 'grey-button' | 12 | @Input() className = 'grey-button' |
13 | @Input() icon: GlobalIconName = undefined | 13 | @Input() icon: GlobalIconName = undefined |
14 | @Input() routerLink: string[] | string | ||
14 | @Input() title: string = undefined | 15 | @Input() title: string = undefined |
15 | @Input() loading = false | 16 | @Input() loading = false |
16 | @Input() disabled = false | 17 | @Input() disabled = false |
17 | @Input() responsiveLabel = false | 18 | @Input() responsiveLabel = false |
18 | 19 | ||
19 | getClasses () { | 20 | classes: { [id: string]: boolean } = {} |
20 | return { | 21 | |
22 | ngOnChanges () { | ||
23 | this.classes = { | ||
21 | [this.className]: true, | 24 | [this.className]: true, |
22 | disabled: this.disabled, | 25 | disabled: this.disabled, |
23 | 'icon-only': !this.label, | 26 | 'icon-only': !this.label, |
27 | 'has-icon': !!this.icon, | ||
24 | 'responsive-label': this.responsiveLabel | 28 | 'responsive-label': this.responsiveLabel |
25 | } | 29 | } |
26 | } | 30 | } |