Adjusted thresholds for consolidating download action buttons

This commit is contained in:
Tzahi12345
2023-05-22 23:51:15 -04:00
parent b8eb639a59
commit a6478a50f2
2 changed files with 6 additions and 2 deletions

View File

@@ -54,7 +54,7 @@
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef [ngStyle]="{flex: actionsFlex}"> <ng-container i18n="Actions">Actions</ng-container> </mat-header-cell>
<mat-cell *matCellDef="let element" [ngStyle]="{flex: actionsFlex}">
<div *ngIf="!uids && innerWidth >= 800">
<div *ngIf="!minimizeButtons">
<ng-container *ngFor="let downloadAction of downloadActions">
<span class="button-span">
<mat-spinner [diameter]="28" *ngIf="downloadAction.loading && downloadAction.loading(element)" class="icon-button-spinner"></mat-spinner>
@@ -62,7 +62,7 @@
</span>
</ng-container>
</div>
<div *ngIf="uids || innerWidth < 800">
<div *ngIf="minimizeButtons">
<button [matMenuTriggerFor]="download_actions" mat-icon-button><mat-icon>more_vert</mat-icon></button>
<mat-menu #download_actions="matMenu">
<ng-container *ngFor="let downloadAction of downloadActions">

View File

@@ -39,6 +39,7 @@ export class DownloadsComponent implements OnInit, OnDestroy {
}
actionsFlex = 2;
minimizeButtons = false;
displayedColumnsBig: string[] = ['timestamp_start', 'title', 'sub_name', 'percent_complete', 'actions'];
displayedColumnsSmall: string[] = ['title', 'percent_complete', 'actions'];
displayedColumns: string[] = this.displayedColumnsBig;
@@ -328,6 +329,9 @@ export class DownloadsComponent implements OnInit, OnDestroy {
else this.displayedColumns = this.displayedColumnsBig;
this.actionsFlex = this.uids || this.innerWidth < 800 ? 1 : 2;
if (this.innerWidth < 800 && !this.uids || this.innerWidth < 1100 && this.uids) this.minimizeButtons = true;
else this.minimizeButtons = false;
}
}