From a6f214d462c19b061bbbbb08acc1411bf3bf2445 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 20 Feb 2023 12:14:57 +0100 Subject: Fix reset zoom button --- .../src/app/shared/shared-main/buttons/button.component.html | 4 ++-- .../src/app/shared/shared-main/buttons/button.component.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'client') diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html index bf0fb3916..20c982744 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.html +++ b/client/src/app/shared/shared-main/buttons/button.component.html @@ -1,6 +1,6 @@ -
+
+ 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 1761938ee..63a59cbe1 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 @@ -import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core' +import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit } from '@angular/core' import { GlobalIconName } from '@app/shared/shared-icons' @Component({ @@ -8,7 +8,7 @@ import { GlobalIconName } from '@app/shared/shared-icons' changeDetection: ChangeDetectionStrategy.OnPush }) -export class ButtonComponent implements OnChanges { +export class ButtonComponent implements OnInit, OnChanges { @Input() label = '' @Input() className = 'grey-button' @Input() icon: GlobalIconName = undefined @@ -20,7 +20,15 @@ export class ButtonComponent implements OnChanges { classes: { [id: string]: boolean } = {} + ngOnInit () { + this.buildClasses() + } + ngOnChanges () { + this.buildClasses() + } + + private buildClasses () { this.classes = { [this.className]: true, disabled: this.disabled, -- cgit v1.2.3