Add download client logos to filter UI with fallback handling
Some checks failed
Some checks failed
This commit is contained in:
@@ -1174,6 +1174,21 @@ function updateDownloadClientFilter() {
|
||||
toggleClientSelection(index, e.target.checked);
|
||||
});
|
||||
|
||||
// Add client icon
|
||||
const iconWrapper = document.createElement('span');
|
||||
iconWrapper.className = 'download-client-icon';
|
||||
|
||||
const iconImg = document.createElement('img');
|
||||
iconImg.src = `/images/clients/${client.type}.svg`;
|
||||
iconImg.alt = `${client.name} icon`;
|
||||
iconImg.onerror = () => {
|
||||
// Fallback to text if image fails to load
|
||||
iconWrapper.textContent = client.type.charAt(0).toUpperCase();
|
||||
iconWrapper.classList.add('fallback');
|
||||
};
|
||||
|
||||
iconWrapper.appendChild(iconImg);
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.className = 'download-client-option-label';
|
||||
label.htmlFor = checkboxId;
|
||||
@@ -1184,6 +1199,7 @@ function updateDownloadClientFilter() {
|
||||
typeBadge.textContent = client.type;
|
||||
|
||||
option.appendChild(checkbox);
|
||||
option.appendChild(iconWrapper);
|
||||
option.appendChild(label);
|
||||
option.appendChild(typeBadge);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user