Fix reset zoom button

pull/5616/head
Chocobozzz 2023-02-20 12:14:57 +01:00
parent 3ebb2987c2
commit a6f214d462
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<div *ngIf="!routerLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title" tabindex="0">
<button *ngIf="!routerLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title">
<ng-container *ngTemplateOutlet="content"></ng-container>
</div>
</button>
<a *ngIf="routerLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title" [routerLink]="routerLink">
<ng-container *ngTemplateOutlet="content"></ng-container>

View File

@ -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,