From 6f67f386007c6b6aed37c1e06cf21c5db9490fa0 Mon Sep 17 00:00:00 2001 From: Eugene Kallivrousis Date: Tue, 8 Apr 2025 15:20:56 -0400 Subject: [PATCH] Adding a select all button for the delete torrent popup --- .../torrent-table/torrent-table.component.html | 15 +++++++++++---- .../app/torrent-table/torrent-table.component.ts | 12 ++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/client/src/app/torrent-table/torrent-table.component.html b/client/src/app/torrent-table/torrent-table.component.html index b728bdc..5524fce 100644 --- a/client/src/app/torrent-table/torrent-table.component.html +++ b/client/src/app/torrent-table/torrent-table.component.html @@ -106,20 +106,27 @@
-
diff --git a/client/src/app/torrent-table/torrent-table.component.ts b/client/src/app/torrent-table/torrent-table.component.ts index 3f17925..782b6c5 100644 --- a/client/src/app/torrent-table/torrent-table.component.ts +++ b/client/src/app/torrent-table/torrent-table.component.ts @@ -20,6 +20,7 @@ export class TorrentTableComponent implements OnInit { public isDeleteModalActive: boolean; public deleteError: string; public deleting: boolean; + public selectAll: boolean; public deleteData: boolean; public deleteRdTorrent: boolean; public deleteLocalFiles: boolean; @@ -247,4 +248,15 @@ export class TorrentTableComponent implements OnInit { }, }); } + // Called when "Select All" is toggled + toggleAllOptions() { + this.deleteData = this.selectAll; + this.deleteRdTorrent = this.selectAll; + this.deleteLocalFiles = this.selectAll; + } + + // Called when any individual checkbox is toggled + updateSelectAll() { + this.selectAll = this.deleteData && this.deleteRdTorrent && this.deleteLocalFiles; + } }