fix: Correct group toggle functionality
Fix the toggleGroup() function to properly collapse/expand grouped downloads:
- Use classList.contains('collapsed') to check state instead of checking style.display
- Properly add/remove 'collapsed' class on toggle
- Groups now correctly collapse when clicked and expand when clicked again
- Arrow rotates correctly with CSS transition
The previous implementation checked items.style.display which was initially empty,
causing the toggle to not work correctly. Now we use the CSS class as the source of truth.
This commit is contained in:
+11
-2
@@ -1646,8 +1646,17 @@
|
|||||||
|
|
||||||
function toggleGroup(header) {
|
function toggleGroup(header) {
|
||||||
const items = header.nextElementSibling;
|
const items = header.nextElementSibling;
|
||||||
items.style.display = items.style.display === 'none' ? 'flex' : 'none';
|
const isCollapsed = header.classList.contains('collapsed');
|
||||||
header.classList.toggle('collapsed');
|
|
||||||
|
if (isCollapsed) {
|
||||||
|
// Expand
|
||||||
|
items.style.display = 'flex';
|
||||||
|
header.classList.remove('collapsed');
|
||||||
|
} else {
|
||||||
|
// Collapse
|
||||||
|
items.style.display = 'none';
|
||||||
|
header.classList.add('collapsed');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function pauseDownload(id) {
|
async function pauseDownload(id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user