From faf7eab7d9528451570a26e27093159045346064 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 29 Apr 2021 09:46:44 +0200 Subject: Cleanup plugins admin CSS --- .../shared-main/buttons/button.component.scss | 22 ++++++++++++++++------ .../shared/shared-main/buttons/button.component.ts | 6 ++++-- .../buttons/delete-button.component.html | 5 ++++- .../shared-main/buttons/delete-button.component.ts | 1 + .../shared-main/buttons/edit-button.component.html | 5 ++++- .../shared-main/buttons/edit-button.component.ts | 2 +- 6 files changed, 30 insertions(+), 11 deletions(-) (limited to 'client/src/app/shared/shared-main/buttons') 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 @@ @import '_variables'; @import '_mixins'; +@mixin responsive-label { + .action-button { + padding: 0 13px; + } + + .button-label { + display: none; + } +} + :host { outline: none; } @@ -46,12 +56,12 @@ span[class$=-button] { // In a table, try to minimize the space taken by this button @media screen and (max-width: 1400px) { :host-context(td) { - .action-button { - padding: 0 13px; - } + @include responsive-label; + } +} - .button-label { - display: none; - } +@media screen and (max-width: $small-view) { + .responsive-label { + @include responsive-label; } } 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' @Component({ selector: 'my-button', - styleUrls: ['./button.component.scss'], + styleUrls: [ './button.component.scss' ], templateUrl: './button.component.html' }) @@ -14,6 +14,7 @@ export class ButtonComponent { @Input() title: string = undefined @Input() loading = false @Input() disabled = false + @Input() responsiveLabel = false getTitle () { return this.title || this.label @@ -22,7 +23,8 @@ export class ButtonComponent { getClasses () { return { [this.className]: true, - disabled: this.disabled + disabled: this.disabled, + 'responsive-label': this.responsiveLabel } } } 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 @@ - + {{ label }} 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' export class DeleteButtonComponent implements OnInit { @Input() label: string @Input() title: string + @Input() responsiveLabel = false ngOnInit () { // 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 @@ - + {{ label }} 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' styleUrls: [ './button.component.scss' ], templateUrl: './edit-button.component.html' }) - export class EditButtonComponent implements OnInit { @Input() label: string @Input() title: string @Input() routerLink: string[] | string = [] + @Input() responsiveLabel = false ngOnInit () { // No label -- cgit v1.2.3