mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-07 20:10:03 +03:00
Added back loading spinner to download actions
This commit is contained in:
@@ -56,14 +56,17 @@
|
||||
<mat-cell *matCellDef="let element" [ngStyle]="{flex: actionsFlex}">
|
||||
<div *ngIf="!uids && innerWidth >= 800">
|
||||
<ng-container *ngFor="let downloadAction of downloadActions">
|
||||
<button *ngIf="downloadAction.show(element)" (click)="downloadAction.action(element)" [matTooltip]="downloadAction.tooltip" mat-icon-button><mat-icon>{{downloadAction.icon}}</mat-icon></button>
|
||||
<span class="button-span">
|
||||
<mat-spinner [diameter]="28" *ngIf="downloadAction.loading && downloadAction.loading(element)" class="icon-button-spinner"></mat-spinner>
|
||||
<button *ngIf="downloadAction.show(element)" (click)="downloadAction.action(element)" [disabled]="downloadAction.loading && downloadAction.loading(element)" [matTooltip]="downloadAction.tooltip" mat-icon-button><mat-icon>{{downloadAction.icon}}</mat-icon></button>
|
||||
</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div *ngIf="uids || innerWidth < 800">
|
||||
<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">
|
||||
<button *ngIf="downloadAction.show(element)" (click)="downloadAction.action(element)" mat-menu-item>
|
||||
<button *ngIf="downloadAction.show(element)" (click)="downloadAction.action(element)" [disabled]="downloadAction.loading && downloadAction.loading(element)" mat-menu-item>
|
||||
<mat-icon>{{downloadAction.icon}}</mat-icon>
|
||||
<span>{{downloadAction.tooltip}}</span>
|
||||
</button>
|
||||
|
||||
@@ -10,8 +10,12 @@ mat-header-cell, mat-cell {
|
||||
|
||||
.icon-button-spinner {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 6px;
|
||||
top: -13px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.button-span {
|
||||
position: relative;;
|
||||
}
|
||||
|
||||
.downloads-action-button-div {
|
||||
|
||||
@@ -68,7 +68,8 @@ export class DownloadsComponent implements OnInit, OnDestroy {
|
||||
tooltip: $localize`Pause`,
|
||||
action: (download: Download) => this.pauseDownload(download),
|
||||
show: (download: Download) => !download.finished && (!download.paused || !download.finished_step),
|
||||
icon: 'pause'
|
||||
icon: 'pause',
|
||||
loading: (download: Download) => download.paused && !download.finished_step
|
||||
},
|
||||
{
|
||||
tooltip: $localize`Resume`,
|
||||
@@ -334,5 +335,6 @@ interface DownloadAction {
|
||||
tooltip: string,
|
||||
action: (download: Download) => void,
|
||||
show: (download: Download) => boolean,
|
||||
icon: string
|
||||
icon: string,
|
||||
loading?: (download: Download) => boolean
|
||||
}
|
||||
Reference in New Issue
Block a user