diff options
Diffstat (limited to 'client/src/app/shared/shared-main')
6 files changed, 30 insertions, 11 deletions
diff --git a/client/src/app/shared/shared-main/buttons/button.component.scss b/client/src/app/shared/shared-main/buttons/button.component.scss index f73b7b808..09b5f95d7 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.scss +++ b/client/src/app/shared/shared-main/buttons/button.component.scss | |||
@@ -1,6 +1,16 @@ | |||
1 | @import '_variables'; | 1 | @import '_variables'; |
2 | @import '_mixins'; | 2 | @import '_mixins'; |
3 | 3 | ||
4 | @mixin responsive-label { | ||
5 | .action-button { | ||
6 | padding: 0 13px; | ||
7 | } | ||
8 | |||
9 | .button-label { | ||
10 | display: none; | ||
11 | } | ||
12 | } | ||
13 | |||
4 | :host { | 14 | :host { |
5 | outline: none; | 15 | outline: none; |
6 | } | 16 | } |
@@ -46,12 +56,12 @@ span[class$=-button] { | |||
46 | // In a table, try to minimize the space taken by this button | 56 | // In a table, try to minimize the space taken by this button |
47 | @media screen and (max-width: 1400px) { | 57 | @media screen and (max-width: 1400px) { |
48 | :host-context(td) { | 58 | :host-context(td) { |
49 | .action-button { | 59 | @include responsive-label; |
50 | padding: 0 13px; | 60 | } |
51 | } | 61 | } |
52 | 62 | ||
53 | .button-label { | 63 | @media screen and (max-width: $small-view) { |
54 | display: none; | 64 | .responsive-label { |
55 | } | 65 | @include responsive-label; |
56 | } | 66 | } |
57 | } | 67 | } |
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 1d2be0bf9..ee74b3d12 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.ts +++ b/client/src/app/shared/shared-main/buttons/button.component.ts | |||
@@ -3,7 +3,7 @@ import { GlobalIconName } from '@app/shared/shared-icons' | |||
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-button', | 5 | selector: 'my-button', |
6 | styleUrls: ['./button.component.scss'], | 6 | styleUrls: [ './button.component.scss' ], |
7 | templateUrl: './button.component.html' | 7 | templateUrl: './button.component.html' |
8 | }) | 8 | }) |
9 | 9 | ||
@@ -14,6 +14,7 @@ export class ButtonComponent { | |||
14 | @Input() title: string = undefined | 14 | @Input() title: string = undefined |
15 | @Input() loading = false | 15 | @Input() loading = false |
16 | @Input() disabled = false | 16 | @Input() disabled = false |
17 | @Input() responsiveLabel = false | ||
17 | 18 | ||
18 | getTitle () { | 19 | getTitle () { |
19 | return this.title || this.label | 20 | return this.title || this.label |
@@ -22,7 +23,8 @@ export class ButtonComponent { | |||
22 | getClasses () { | 23 | getClasses () { |
23 | return { | 24 | return { |
24 | [this.className]: true, | 25 | [this.className]: true, |
25 | disabled: this.disabled | 26 | disabled: this.disabled, |
27 | 'responsive-label': this.responsiveLabel | ||
26 | } | 28 | } |
27 | } | 29 | } |
28 | } | 30 | } |
diff --git a/client/src/app/shared/shared-main/buttons/delete-button.component.html b/client/src/app/shared/shared-main/buttons/delete-button.component.html index c94d8d0c9..d7a6702a7 100644 --- a/client/src/app/shared/shared-main/buttons/delete-button.component.html +++ b/client/src/app/shared/shared-main/buttons/delete-button.component.html | |||
@@ -1,4 +1,7 @@ | |||
1 | <span class="action-button action-button-delete grey-button" [ngbTooltip]="title" role="button" tabindex="0"> | 1 | <span |
2 | class="action-button action-button-delete grey-button" | ||
3 | [ngClass]="{ 'responsive-label': responsiveLabel }" [ngbTooltip]="title" role="button" tabindex="0" | ||
4 | > | ||
2 | <my-global-icon iconName="delete" aria-hidden="true"></my-global-icon> | 5 | <my-global-icon iconName="delete" aria-hidden="true"></my-global-icon> |
3 | 6 | ||
4 | <span class="button-label" *ngIf="label">{{ label }}</span> | 7 | <span class="button-label" *ngIf="label">{{ label }}</span> |
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 18995422a..c091f5309 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,6 +9,7 @@ import { Component, Input, OnInit } from '@angular/core' | |||
9 | export class DeleteButtonComponent implements OnInit { | 9 | export class DeleteButtonComponent implements OnInit { |
10 | @Input() label: string | 10 | @Input() label: string |
11 | @Input() title: string | 11 | @Input() title: string |
12 | @Input() responsiveLabel = false | ||
12 | 13 | ||
13 | ngOnInit () { | 14 | ngOnInit () { |
14 | // <my-delete-button /> No label | 15 | // <my-delete-button /> No label |
diff --git a/client/src/app/shared/shared-main/buttons/edit-button.component.html b/client/src/app/shared/shared-main/buttons/edit-button.component.html index ecb709be1..8beeee6c4 100644 --- a/client/src/app/shared/shared-main/buttons/edit-button.component.html +++ b/client/src/app/shared/shared-main/buttons/edit-button.component.html | |||
@@ -1,4 +1,7 @@ | |||
1 | <a class="action-button action-button-edit grey-button" [routerLink]="routerLink" [ngbTooltip]="title"> | 1 | <a |
2 | class="action-button action-button-edit grey-button" | ||
3 | [ngClass]="{ 'responsive-label': responsiveLabel }" [routerLink]="routerLink" [ngbTooltip]="title" | ||
4 | > | ||
2 | <my-global-icon iconName="edit" aria-hidden="true"></my-global-icon> | 5 | <my-global-icon iconName="edit" aria-hidden="true"></my-global-icon> |
3 | 6 | ||
4 | <span class="button-label" *ngIf="label">{{ label }}</span> | 7 | <span class="button-label" *ngIf="label">{{ label }}</span> |
diff --git a/client/src/app/shared/shared-main/buttons/edit-button.component.ts b/client/src/app/shared/shared-main/buttons/edit-button.component.ts index 4b76551ca..24c8625ff 100644 --- a/client/src/app/shared/shared-main/buttons/edit-button.component.ts +++ b/client/src/app/shared/shared-main/buttons/edit-button.component.ts | |||
@@ -5,11 +5,11 @@ import { Component, Input, OnInit } from '@angular/core' | |||
5 | styleUrls: [ './button.component.scss' ], | 5 | styleUrls: [ './button.component.scss' ], |
6 | templateUrl: './edit-button.component.html' | 6 | templateUrl: './edit-button.component.html' |
7 | }) | 7 | }) |
8 | |||
9 | export class EditButtonComponent implements OnInit { | 8 | export class EditButtonComponent implements OnInit { |
10 | @Input() label: string | 9 | @Input() label: string |
11 | @Input() title: string | 10 | @Input() title: string |
12 | @Input() routerLink: string[] | string = [] | 11 | @Input() routerLink: string[] | string = [] |
12 | @Input() responsiveLabel = false | ||
13 | 13 | ||
14 | ngOnInit () { | 14 | ngOnInit () { |
15 | // <my-edit-button /> No label | 15 | // <my-edit-button /> No label |