UI: restore option to hide clear button for image input

This commit is contained in:
Chantsova Ekaterina 2023-08-28 17:51:02 +03:00
parent bff3297c56
commit 0e8f5fbe36
2 changed files with 5 additions and 2 deletions

View File

@ -25,7 +25,7 @@
<div class="tb-image-preview-text" *ngIf="!safeImageUrl && disabled; else elseBlock">{{ 'dashboard.empty-image' | translate }}</div> <div class="tb-image-preview-text" *ngIf="!safeImageUrl && disabled; else elseBlock">{{ 'dashboard.empty-image' | translate }}</div>
<ng-template #elseBlock><img class="tb-image-preview" [src]="safeImageUrl" /></ng-template> <ng-template #elseBlock><img class="tb-image-preview" [src]="safeImageUrl" /></ng-template>
</div> </div>
<button *ngIf="safeImageUrl && !disabled" <button *ngIf="safeImageUrl && showClearButton && !disabled"
mat-icon-button color="primary" mat-icon-button color="primary"
class="tb-mat-24" class="tb-mat-24"
type="button" type="button"
@ -52,7 +52,7 @@
</div> </div>
</div> </div>
</div> </div>
<button *ngIf="!showPreview && safeImageUrl && !disabled" <button *ngIf="!showPreview && safeImageUrl && showClearButton && !disabled"
mat-icon-button color="primary" mat-icon-button color="primary"
class="tb-mat-24" class="tb-mat-24"
type="button" type="button"

View File

@ -65,6 +65,9 @@ export class ImageInputComponent extends PageComponent implements AfterViewInit,
@Input() @Input()
disabled: boolean; disabled: boolean;
@Input()
showClearButton = true;
@Input() @Input()
showPreview = true; showPreview = true;